Methods
Class Public methods
new(entries) Link
Instance Public methods
build_record(entry) Link
: (Array) -> ActiveRecord::Base
# File activerecord/lib/active_record/message_pack.rb, line 118 def build_record(entry) class_name, attributes_hash, is_new_record, * = entry klass = ActiveSupport::MessagePack::Extensions.load_class(class_name) builder = klass.attributes_builder attributes = builder.build_from_indexed_row(builder.row_from_hash(attributes_hash)) klass.allocate.init_with_attributes(attributes, is_new_record) end
decode(ref) Link
resolve_cached_associations(record, entry) Link
# File activerecord/lib/active_record/message_pack.rb, line 126 def resolve_cached_associations(record, entry) i = 3 # entry == [class_name, attributes_hash, is_new_record, *associations] while i < entry.length begin record.association(entry[i]).target = decode(entry[i + 1]) rescue ActiveRecord::AssociationNotFoundError # The association no longer exists, so just skip it. end i += 2 end end