module Bullet::ActiveRecord

def construct(ar_parent, parent, row, rs, seen, model_cache, aliases)

def construct(ar_parent, parent, row, rs, seen, model_cache, aliases)
  if Bullet.start?
    unless ar_parent.nil?
      parent.children.each do |node|
        key = aliases.column_alias(node, node.primary_key)
        id = row[key]
        next unless id.nil?
        associations = [node.reflection.name]
        if node.reflection.nested?
          associations << node.reflection.through_reflection.name
        end
        associations.each do |association|
          Bullet::Detector::Association.add_object_associations(ar_parent, association)
          Bullet::Detector::NPlusOneQuery.call_association(ar_parent, association)
          @bullet_eager_loadings[ar_parent.class] ||= {}
          @bullet_eager_loadings[ar_parent.class][ar_parent] ||= Set.new
          @bullet_eager_loadings[ar_parent.class][ar_parent] << association
        end
      end
    end
  end
  origin_construct(ar_parent, parent, row, rs, seen, model_cache, aliases)
end