instance method
marshal_load
Ruby on Rails 8.1.2
Since v7.1.6Signature
marshal_load(state)
No documentation comment.
Parameters
-
statereq
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