Methods

DataMapper::Adapters::InMemoryAdapterAdjust

Public Instance Methods

adjust(attributes, collection) click to toggle source
# File lib/dm-adjust/adapters/in_memory_adapter.rb, line 4
def adjust(attributes, collection)
  attributes = attributes_as_fields(attributes)
  read(collection.query).each do |record|
    record.update(attributes) do |key, oldvalue, newvalue|
      (oldvalue || 0) + newvalue
    end
  end.size
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.