Sha256: 3d2ce6426b4e99132ad23ac399cfbc245beef94cf79c6cf336ec0dedea99c2c2

Contents?: true

Size: 463 Bytes

Versions: 10

Compression:

Stored size: 463 Bytes

Contents

# encoding: UTF-8
module MongoMapper
  module Plugins
    module Associations
      class OneAsProxy < OneProxy
        protected
          def criteria
            {type_key_name => proxy_owner.class.name, id_key_name => proxy_owner.id}
          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

10 entries across 10 versions & 3 rubygems

Version Path
mongo_mapper-0.13.0.beta2 lib/mongo_mapper/plugins/associations/one_as_proxy.rb
mongo_mapper-0.13.0.beta1 lib/mongo_mapper/plugins/associations/one_as_proxy.rb
mongo_mapper-0.12.0 lib/mongo_mapper/plugins/associations/one_as_proxy.rb
lookout-mongo_mapper-0.11.3 lib/mongo_mapper/plugins/associations/one_as_proxy.rb
mongo_mapper-0.11.2 lib/mongo_mapper/plugins/associations/one_as_proxy.rb
jamieorc-mongo_mapper-0.11.1.1 lib/mongo_mapper/plugins/associations/one_as_proxy.rb
mongo_mapper-0.11.1 lib/mongo_mapper/plugins/associations/one_as_proxy.rb
mongo_mapper-0.11.0 lib/mongo_mapper/plugins/associations/one_as_proxy.rb
mongo_mapper-0.10.1 lib/mongo_mapper/plugins/associations/one_as_proxy.rb
mongo_mapper-0.10.0 lib/mongo_mapper/plugins/associations/one_as_proxy.rb