instance method
add_cached_associations
Ruby on Rails 8.1.2
Since v7.1.6Signature
add_cached_associations(record, entry)
No documentation comment.
Parameters
-
recordreq -
entryreq
Source
# File activerecord/lib/active_record/message_pack.rb, line 81
def add_cached_associations(record, entry)
record.class.normalized_reflections.each_value do |reflection|
if record.association_cached?(reflection.name) && record.association(reflection.name).loaded?
entry << reflection.name << encode(record.association(reflection.name).target)
end
end
end
Defined in activerecord/lib/active_record/message_pack.rb line 81
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::MessagePack::Encoder