Sha256: b460a94e2e359b7419bf416fc792b36f392acc754d8271a074a8b94e6810c3bd
Contents?: true
Size: 581 Bytes
Versions: 19
Compression:
Stored size: 581 Bytes
Contents
module MongoMapper 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
Version data entries
19 entries across 19 versions & 4 rubygems