Sha256: 8a76b2d8c12295d5fd83a0493fc431932da0cbb91b2d390184a75b6ac24015f7

Contents?: true

Size: 454 Bytes

Versions: 19

Compression:

Stored size: 454 Bytes

Contents

module ActiveRecord
  module Associations
    class Preloader
      class BelongsTo
        def query_scope(ids)
          # CPK
          # scope.where(association_key.in(ids))

          if association_key_name.is_a?(Array)
            predicate = cpk_in_predicate(table, association_key_name, ids)
            scope.where(predicate)
          else
            scope.where(association_key.in(ids))
          end
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
composite_primary_keys-7.0.15 lib/composite_primary_keys/associations/preloader/belongs_to.rb
composite_primary_keys-8.1.1 lib/composite_primary_keys/associations/preloader/belongs_to.rb
composite_primary_keys-7.0.14 lib/composite_primary_keys/associations/preloader/belongs_to.rb
composite_primary_keys-8.1.0 lib/composite_primary_keys/associations/preloader/belongs_to.rb
composite_primary_keys-7.0.13 lib/composite_primary_keys/associations/preloader/belongs_to.rb
composite_primary_keys-8.0.0 lib/composite_primary_keys/associations/preloader/belongs_to.rb
composite_primary_keys-7.0.12 lib/composite_primary_keys/associations/preloader/belongs_to.rb
composite_primary_keys-7.0.11 lib/composite_primary_keys/associations/preloader/belongs_to.rb
composite_primary_keys-7.0.10 lib/composite_primary_keys/associations/preloader/belongs_to.rb
composite_primary_keys-7.0.9 lib/composite_primary_keys/associations/preloader/belongs_to.rb
composite_primary_keys-7.0.8 lib/composite_primary_keys/associations/preloader/belongs_to.rb
composite_primary_keys-7.0.7 lib/composite_primary_keys/associations/preloader/belongs_to.rb
composite_primary_keys-7.0.6 lib/composite_primary_keys/associations/preloader/belongs_to.rb
composite_primary_keys-7.0.5 lib/composite_primary_keys/associations/preloader/belongs_to.rb
composite_primary_keys-7.0.4 lib/composite_primary_keys/associations/preloader/belongs_to.rb
composite_primary_keys-7.0.3 lib/composite_primary_keys/associations/preloader/belongs_to.rb
composite_primary_keys-7.0.2 lib/composite_primary_keys/associations/preloader/belongs_to.rb
composite_primary_keys-7.0.1 lib/composite_primary_keys/associations/preloader/belongs_to.rb
composite_primary_keys-7.0.0 lib/composite_primary_keys/associations/preloader/belongs_to.rb