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

Version Path
mrkurt-mongo_mapper-0.6.11 lib/mongo_mapper/associations/many_documents_as_proxy.rb
mongo_mapper-unstable-2010.1.6 lib/mongo_mapper/associations/many_documents_as_proxy.rb
mongo_mapper-unstable-2010.1.5 lib/mongo_mapper/associations/many_documents_as_proxy.rb
mongo_mapper-unstable-2010.1.4 lib/mongo_mapper/associations/many_documents_as_proxy.rb
tpitale-mongo_mapper-0.6.10 lib/mongo_mapper/associations/many_documents_as_proxy.rb
mrkurt-mongo_mapper-0.6.10 lib/mongo_mapper/associations/many_documents_as_proxy.rb
mongo_mapper-0.6.10 lib/mongo_mapper/associations/many_documents_as_proxy.rb
mrkurt-mongo_mapper-0.6.9 lib/mongo_mapper/associations/many_documents_as_proxy.rb
mongo_mapper-0.6.9 lib/mongo_mapper/associations/many_documents_as_proxy.rb
mrkurt-mongo_mapper-0.6.8 lib/mongo_mapper/associations/many_documents_as_proxy.rb
tpitale-mongo_mapper-0.6.9 lib/mongo_mapper/associations/many_documents_as_proxy.rb
mongo_mapper-unstable-2009.12.30 lib/mongo_mapper/associations/many_documents_as_proxy.rb
mongo_mapper-unstable-2009.12.29 lib/mongo_mapper/associations/many_documents_as_proxy.rb
mongo_mapper-unstable-2009.12.23 lib/mongo_mapper/associations/many_documents_as_proxy.rb
mongo_mapper-unstable-2009.12.22 lib/mongo_mapper/associations/many_documents_as_proxy.rb
mongo_mapper-unstable-2009.12.16 lib/mongo_mapper/associations/many_documents_as_proxy.rb
mongo_mapper-0.6.8 lib/mongo_mapper/associations/many_documents_as_proxy.rb
mongo_mapper-unstable-2009.12.14 lib/mongo_mapper/associations/many_documents_as_proxy.rb
mongo_mapper-0.6.7 lib/mongo_mapper/associations/many_documents_as_proxy.rb