Sha256: 51eae8b0e080786afb05e3b6731198e1f34fa40b171af62dcbe7c69c5a9167b8

Contents?: true

Size: 517 Bytes

Versions: 24

Compression:

Stored size: 517 Bytes

Contents

module MongoMapper
  module Plugins
    module Associations
      class ManyEmbeddedProxy < EmbeddedCollection
        def replace(values)
          @_values = values.map do |v|
            v.respond_to?(:attributes) ? v.attributes : v
          end
          reset
        end

        private
          def find_target
            (@_values || []).map do |v|
              child = klass.load(v)
              assign_root_document(child)
              child
            end
          end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 3 rubygems

Version Path
novelys_mongo_mapper-0.6.12 lib/novelys_mongo_mapper/plugins/associations/many_embedded_proxy.rb
novelys_mongo_mapper-0.6.11 lib/novelys_mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.2.3 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
novelys_mongo_mapper-0.6.10 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.2.2 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.2.1 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.1.31 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.1.30 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.1.29 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.1.28 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.1.27 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.1.26 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.1.25 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.1.22 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.1.21 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.1.20 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.1.19 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
jmonteiro-mongo_mapper-0.1.7 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.1.18 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
jmonteiro-mongo_mapper-0.1.6 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb