Sha256: fb8aa6bc6d525614168e2002a99b31925c4f5425b2062f6bf26a553706d14905
Contents?: true
Size: 630 Bytes
Versions: 62
Compression:
Stored size: 630 Bytes
Contents
module MongoMapper module Plugins module Associations class ManyDocumentsAsProxy < ManyDocumentsProxy protected def scoped_conditions {type_key_name => owner.class.name, id_key_name => owner.id} end def apply_scope(doc) ensure_owner_saved doc[type_key_name] = owner.class.name doc[id_key_name] = owner.id doc end private def type_key_name "#{options[:as]}_type" end def id_key_name "#{options[:as]}_id" end end end end end
Version data entries
62 entries across 62 versions & 9 rubygems