instance method add_cached_associations

Ruby on Rails 8.0.4

Since v7.1.6

Available in: v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

add_cached_associations(record, entry)

No documentation comment.

Parameters

record req
entry req
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

Type at least 2 characters to search.

↑↓ navigate · open · esc close