Class: OccamsRecord::EagerLoaders::HasMany

Inherits:
HasOne
  • Object
show all
Defined in:
lib/occams-record/eager_loaders/has_many.rb

Overview

Eager loader for has_many associations.

Instance Attribute Summary

Attributes inherited from Base

#eval_block, #name, #use

Instance Method Summary collapse

Methods inherited from HasOne

#query

Methods inherited from Base

#initialize, #query

Constructor Details

This class inherits a constructor from OccamsRecord::EagerLoaders::Base

Instance Method Details

#merge!(assoc_rows, rows) ⇒ Object

Merge the association rows into the given rows.

Parameters:



11
12
13
14
# File 'lib/occams-record/eager_loaders/has_many.rb', line 11

def merge!(assoc_rows, rows)
  Merge.new(rows, name).
    many!(assoc_rows, @ref.active_record_primary_key, @ref.foreign_key)
end