Class: ActiveRecord::Associations::AssociationScope
- Inherits:
-
Object
- Object
- ActiveRecord::Associations::AssociationScope
- Defined in:
- lib/active_record/associations/association_scope.rb
Overview
:nodoc:
Constant Summary collapse
- INSTANCE =
new
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.scope(association, connection) ⇒ Object
6 7 8 |
# File 'lib/active_record/associations/association_scope.rb', line 6 def self.scope(association, connection) INSTANCE.scope association, connection end |
Instance Method Details
#join_type ⇒ Object
21 22 23 |
# File 'lib/active_record/associations/association_scope.rb', line 21 def join_type Arel::Nodes::InnerJoin end |
#scope(association, connection) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/active_record/associations/association_scope.rb', line 10 def scope(association, connection) klass = association.klass reflection = association.reflection scope = klass.unscoped owner = association.owner alias_tracker = AliasTracker.empty connection scope.extending! Array(reflection.[:extend]) add_constraints(scope, owner, klass, reflection, alias_tracker) end |