Sha256: 772df2ef04e8ce5dab3e99a0c4b767e4d8c8cf1026b9869c9a1cf699e31336cf
Contents?: true
Size: 867 Bytes
Versions: 10
Compression:
Stored size: 867 Bytes
Contents
# frozen_string_literal: true module EacRailsUtils module Models module TablelessAssociations module AssociationScopeExtension if ActiveRecord.version >= Gem::Version.new('5.0.0.beta') def add_constraints(scope, owner, association_klass, refl, chain_head, chain_tail) # rubocop:disable Metrics/ParameterLists if refl.options[:active_model] target_ids = refl.options[:target_ids] return scope.where(id: owner[target_ids]) end super end else def add_constraints(scope, owner, assoc_klass, refl, tracker) if refl.options[:active_model] target_ids = refl.options[:target_ids] return scope.where(id: owner[target_ids]) end super end end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems