Module: EacRailsUtils::Models::TablelessAssociations::AssociationScopeExtension
- Defined in:
- lib/eac_rails_utils/models/tableless_associations/association_scope_extension.rb
Instance Method Summary collapse
-
#add_constraints(scope, owner, assoc_klass, refl, tracker) ⇒ Object
rubocop:disable Metrics/ParameterLists.
Instance Method Details
#add_constraints(scope, owner, assoc_klass, refl, tracker) ⇒ Object
rubocop:disable Metrics/ParameterLists
8 9 10 11 12 13 14 15 |
# File 'lib/eac_rails_utils/models/tableless_associations/association_scope_extension.rb', line 8 def add_constraints(scope, owner, association_klass, refl, chain_head, chain_tail) # rubocop:disable Metrics/ParameterLists if refl.[:active_model] target_ids = refl.[:target_ids] return scope.where(id: owner[target_ids]) end super end |