Sha256: ed730c13610c73da87989e788ed6ba77a307c820f036b9c446ed6e0dc6d165fc

Contents?: true

Size: 413 Bytes

Versions: 13

Compression:

Stored size: 413 Bytes

Contents

module ROM
  module SQL
    module Associations
      # Core SQL association API
      #
      # @api private
      module Core
        # @api private
        def preload(target, loaded)
          source_key, target_key = join_keys.flatten(1)

          target_pks = loaded.pluck(source_key.key)
          target_pks.uniq!

          target.where(target_key => target_pks)
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rom-sql-3.0.1 lib/rom/sql/associations/core.rb
rom-sql-3.0.0 lib/rom/sql/associations/core.rb
rom-sql-2.5.0 lib/rom/sql/associations/core.rb
rom-sql-2.4.0 lib/rom/sql/associations/core.rb
rom-sql-2.3.0 lib/rom/sql/associations/core.rb
rom-sql-2.2.1 lib/rom/sql/associations/core.rb
rom-sql-2.2.0 lib/rom/sql/associations/core.rb
rom-sql-2.1.0 lib/rom/sql/associations/core.rb
rom-sql-2.0.0 lib/rom/sql/associations/core.rb
rom-sql-2.0.0.rc1 lib/rom/sql/associations/core.rb
rom-sql-2.0.0.beta3 lib/rom/sql/associations/core.rb
rom-sql-2.0.0.beta2 lib/rom/sql/associations/core.rb
rom-sql-2.0.0.beta1 lib/rom/sql/associations/core.rb