method
scope
v5.0.0.1 -
Show latest stable
- Class:
ActiveRecord::Associations::AssociationScope
scope(association, connection)public
No documentation available.
# File activerecord/lib/active_record/associations/association_scope.rb, line 19
def scope(association, connection)
klass = association.klass
reflection = association.reflection
scope = klass.unscoped
owner = association.owner
alias_tracker = AliasTracker.create connection, association.klass.table_name, klass.type_caster
chain_head, chain_tail = get_chain(reflection, association, alias_tracker)
scope.extending! Array(reflection.options[:extend])
add_constraints(scope, owner, klass, reflection, chain_head, chain_tail)
end