Sha256: 4aeecb635ca1bd5d578530d25303444310ac5eea27b50105081181d2adce93ec

Contents?: true

Size: 514 Bytes

Versions: 28

Compression:

Stored size: 514 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_references(child)
              child
            end
          end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 5 rubygems

Version Path
numon-0.0.1 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-0.7.1 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.3.8 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.3.5 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.3.4 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.3.3 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
drogus-mongo_mapper-0.6.10 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-rails3-0.7.0.1 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.2.28 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.2.27 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.2.26 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.2.25 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.2.24 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.2.23 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.2.22 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.2.19 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.2.18 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.2.17 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.2.16 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
mongo_mapper-unstable-2010.2.15 lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb