method
construct_id_map
v3.0.9 -
Show latest stable
- 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.