method
construct_id_map
v2.3.8 -
Show latest stable
- Class:
ActiveRecord::AssociationPreload::ClassMethods
construct_id_map(records, primary_key=nil)private
Given a collection of ActiveRecord 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.