Sha256: 0d7b444b61bbbc0a9d8081d2f9aadb0791a594b1d5df3f66ffb171e164e5faaa

Contents?: true

Size: 394 Bytes

Versions: 16

Compression:

Stored size: 394 Bytes

Contents

module MongoMapperExt
  module Update
    def safe_update(white_list, values)
      white_list.each do |key|
        send("#{key}=", values[key]) if values.has_key?(key)
      end
    end
  end
end

MongoMapper::EmbeddedDocument.send(:include, MongoMapperExt::Update)
if !MongoMapper::Document.kind_of?(MongoMapperExt::Update)
  MongoMapper::Document.send(:include, MongoMapperExt::Update)
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mongomapper_ext-0.5.2 lib/mongomapper_ext/update.rb
mongomapper_ext-0.5.1 lib/mongomapper_ext/update.rb
mongomapper_ext-0.5.0 lib/mongomapper_ext/update.rb
mongomapper_ext-0.4.0 lib/mongomapper_ext/update.rb
mongomapper_ext-0.3.0 lib/mongomapper_ext/update.rb
mongomapper_ext-0.2.4 lib/mongomapper_ext/update.rb
mongomapper_ext-0.2.3 lib/mongomapper_ext/update.rb
mongomapper_ext-0.2.2 lib/mongomapper_ext/update.rb
mongomapper_ext-0.2.1 lib/mongomapper_ext/update.rb
mongomapper_ext-0.2.0 lib/mongomapper_ext/update.rb
mongomapper_ext-0.1.5 lib/mongomapper_ext/update.rb
mongomapper_ext-0.1.4 lib/mongomapper_ext/update.rb
mongomapper_ext-0.1.3 lib/mongomapper_ext/update.rb
mongomapper_ext-0.1.2 lib/mongomapper_ext/update.rb
mongomapper_ext-0.1.1 lib/mongomapper_ext/update.rb
mongomapper_ext-0.1.0 lib/mongomapper_ext/update.rb