Module: DataMapper::Adapters::YamlAdapterAdjust

### Home Classes Methods

### In Files

- lib/dm-adjust/adapters/yaml_adapter.rb

### Methods

- #adjust

### Files

- LICENSE
- README.rdoc

### Class/Module Index

Quicksearch

- DataMapper
- DataMapper::Adapters
- DataMapper::Adapters::DataObjectsAdapterAdjust
- DataMapper::Adapters::DataObjectsAdapterAdjust::SQL
- DataMapper::Adapters::InMemoryAdapterAdjust
- DataMapper::Adapters::YamlAdapterAdjust
- DataMapper::Collection
- DataMapper::Model
- DataMapper::Repository
- DataMapper::Resource

No matching classes.

# DataMapper::Adapters::YamlAdapterAdjust

### Public Instance Methods

adjust(attributes, collection) click to toggle source

    # File lib/dm-adjust/adapters/yaml_adapter.rb, line 4
    def adjust(attributes, collection)
      attributes = attributes_as_fields(attributes)

      update_records(collection.model) do |records|
        records_to_update = collection.query.filter_records(records.dup)
        records_to_update.each do |record|
          record.update(attributes) do |key, oldvalue, newvalue|
            (oldvalue || 0) + newvalue
          end
        end.size
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.