method

construct_id_map

Importance_1
v3.0.0 - Show latest stable - 0 notes - Class: ActiveRecord::AssociationPreload::ClassMethods
construct_id_map(records, primary_key=nil) private

Given a collection of Active Record objects, constructs a Hash which maps the objects’ IDs to the relevant objects. Returns a 2-tuple (id_to_record_map, ids) where id_to_record_map is the Hash, and ids is an Array of record IDs.

Show source
Register or log in to add new notes.