class method
self.composite_identify
Ruby on Rails 8.0.4
Since v7.1.6Signature
self.composite_identify(label, key)
Returns a consistent, platform-independent hash representing a mapping between the label and the subcomponents of the provided composite key.
Example:
composite_identify("label", [:a, :b, :c]) # => { a: hash_1, b: hash_2, c: hash_3 }
Parameters
-
labelreq -
keyreq
Source
# File activerecord/lib/active_record/fixtures.rb, line 633
def composite_identify(label, key)
key
.index_with
.with_index { |sub_key, index| (identify(label) << index) % MAX_ID }
.with_indifferent_access
end
Defined in activerecord/lib/active_record/fixtures.rb line 633
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::FixtureSet