Sha256: e1d1464f223bea908f5c85d14dd7c0a7c3131340106355081cea5f5168b35afc
Contents?: true
Size: 648 Bytes
Versions: 3
Compression:
Stored size: 648 Bytes
Contents
# encoding: UTF-8 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
3 entries across 3 versions & 2 rubygems