instance method marshal_load

Ruby on Rails 8.1.2

Since v7.1.6

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

Signature

marshal_load(state)

No documentation comment.

Parameters

state req
Source
# File activerecord/lib/active_record/marshalling.rb, line 43
      def marshal_load(state)
        attributes_from_database, new_record, associations = state

        attributes = self.class.attributes_builder.build_from_database(attributes_from_database)
        init_with_attributes(attributes, new_record)

        if associations
          associations.each do |name, target|
            association(name).target = target
          rescue ActiveRecord::AssociationNotFoundError
            # the association no longer exist, we can just skip it.
          end
        end
      end

Defined in activerecord/lib/active_record/marshalling.rb line 43 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Marshalling::Methods

Type at least 2 characters to search.

↑↓ navigate · open · esc close