Sha256: d57daa176146e3cc9255f0279d17e970c3a3ed5d2feb2fffb3e4e1cf6f57b540

Contents?: true

Size: 542 Bytes

Versions: 16

Compression:

Stored size: 542 Bytes

Contents

module ActiveRecord
  class PredicateBuilder
    class AssociationQueryValue
      def queries
        # CPK
        if associated_table.association_join_foreign_key.is_a?(Array)
          if ids.is_a?(ActiveRecord::Relation)
            ids.map do |id|
              id.ids_hash
            end
          else
            [associated_table.association_join_foreign_key.zip(ids).to_h]
          end
        else
          [associated_table.association_join_foreign_key.to_s => ids]
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
composite_primary_keys-12.0.2 lib/composite_primary_keys/relation/predicate_builder/association_query_value.rb
composite_primary_keys-11.3.1 lib/composite_primary_keys/relation/predicate_builder/association_query_value.rb
composite_primary_keys-12.0.1 lib/composite_primary_keys/relation/predicate_builder/association_query_value.rb
composite_primary_keys-12.0.0 lib/composite_primary_keys/relation/predicate_builder/association_query_value.rb
composite_primary_keys-12.0.0.rc5 lib/composite_primary_keys/relation/predicate_builder/association_query_value.rb
composite_primary_keys-12.0.0.rc4 lib/composite_primary_keys/relation/predicate_builder/association_query_value.rb
composite_primary_keys-12.0.0.rc3 lib/composite_primary_keys/relation/predicate_builder/association_query_value.rb
composite_primary_keys-12.0.0.rc2 lib/composite_primary_keys/relation/predicate_builder/association_query_value.rb
composite_primary_keys-12.0.0.rc1 lib/composite_primary_keys/relation/predicate_builder/association_query_value.rb
composite_primary_keys-11.2.0 lib/composite_primary_keys/relation/predicate_builder/association_query_value.rb
composite_primary_keys-11.1.0 lib/composite_primary_keys/relation/predicate_builder/association_query_value.rb
composite_primary_keys-11.0.3 lib/composite_primary_keys/relation/predicate_builder/association_query_value.rb
composite_primary_keys-11.0.2 lib/composite_primary_keys/relation/predicate_builder/association_query_value.rb
composite_primary_keys-11.0.1 lib/composite_primary_keys/relation/predicate_builder/association_query_value.rb
composite_primary_keys-11.0.0 lib/composite_primary_keys/relation/predicate_builder/association_query_value.rb
composite_primary_keys-11.0.0.rc1 lib/composite_primary_keys/relation/predicate_builder/association_query_value.rb