method
wrap_scope
rails latest stable - Class:
ActiveRecord::Associations::Builder::CollectionAssociation
wrap_scope(scope, mod)public
No documentation available.
# File activerecord/lib/active_record/associations/builder/collection_association.rb, line 70
def self.wrap_scope(scope, mod)
if scope
if scope.arity > 0
proc { |owner| instance_exec(owner, &scope).extending(mod) }
else
proc { instance_exec(&scope).extending(mod) }
end
else
proc { extending(mod) }
end
end