Class: AutoScopes::AssociationsChains
- Inherits:
-
Struct
- Object
- Struct
- AutoScopes::AssociationsChains
- Defined in:
- lib/auto_scopes/associations_chains.rb
Instance Attribute Summary collapse
-
#association ⇒ Object
Returns the value of attribute association.
-
#associations ⇒ Object
Returns the value of attribute associations.
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
Instance Attribute Details
#association ⇒ Object
Returns the value of attribute association.
6 7 8 |
# File 'lib/auto_scopes/associations_chains.rb', line 6 def association @association end |
#associations ⇒ Object
Returns the value of attribute associations
2 3 4 |
# File 'lib/auto_scopes/associations_chains.rb', line 2 def associations @associations end |
#klass ⇒ Object
Returns the value of attribute klass
2 3 4 |
# File 'lib/auto_scopes/associations_chains.rb', line 2 def klass @klass end |
#path ⇒ Object
Returns the value of attribute path
2 3 4 |
# File 'lib/auto_scopes/associations_chains.rb', line 2 def path @path end |
Instance Method Details
#look_inside_chain ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/auto_scopes/associations_chains.rb', line 8 def look_inside_chain associations.each_pair do |association_parent, association| self.association = association path.push(association_parent) method_maker.create_association if config.create_scope_for_association if nested_hash? self.class.new(klass, association, path.clone).look_inside_chain else call_methods_maker end end end |