Sha256: 45fcc8a5dcb660f20c9f32e2029d40176fbf47b0cd3e18a1841d491bf2b3999a
Contents?: true
Size: 779 Bytes
Versions: 19
Compression:
Stored size: 779 Bytes
Contents
module Locomotive::Steam module Models class ManyToManyAssociation < ReferencedAssociation def __load__ key = @repository.k(:_id, :in) @repository.local_conditions[key] = @entity[__target_key__] # use order_by from options as the default one for further queries @repository.local_conditions[:order_by] = @options[:order_by] unless @options[:order_by].blank? # all the further calls (method_missing) will be delegated to @repository @repository end def __serialize__(attributes) attributes[__target_key__] = attributes[__name__].try(:map, &:_id) attributes.delete(__name__) end def __target_key__ :"#{__name__.to_s.singularize}_ids" end end end end
Version data entries
19 entries across 19 versions & 1 rubygems