Sha256: a17fe8e1acccf10464c50d5f14057cbc6c2ed8e6b1fea71697762b9357f40d8c
Contents?: true
Size: 549 Bytes
Versions: 36
Compression:
Stored size: 549 Bytes
Contents
module Locomotive::Steam module Models class BelongsToAssociation < ReferencedAssociation def __load__ target_id = @entity[__target_key__] target = @repository.find(target_id) # replace the proxy class by the real target entity @entity[__name__] = target end def __serialize__(attributes) attributes[__target_key__] = attributes[__name__].try(:_id) attributes.delete(__name__) end def __target_key__ :"#{__name__}_id" end end end end
Version data entries
36 entries across 36 versions & 1 rubygems