class ActiveRecord::Associations::AssociationScope

def eval_scope(reflection, scope, owner)

def eval_scope(reflection, scope, owner)
  relation = reflection.build_scope(reflection.aliased_table)
  relation.instance_exec(owner, &scope) || relation
end