class OccamsRecord::EagerLoaders::AdHocOne
Eager loader for an ad hoc association of 0 or 1 records (like belongs_to or has_one).
Private Instance Methods
merge!(assoc_rows, rows)
click to toggle source
Merge
the association rows into the given rows.
@param assoc_rows [Array<OccamsRecord::Results::Row>] rows loaded from the associated table @param rows [Array<OccamsRecord::Results::Row>] rows loaded from the main table
# File lib/occams-record/eager_loaders/ad_hoc_one.rb, line 15 def merge!(assoc_rows, rows) Merge.new(rows, name). single!(assoc_rows, @mapping) end