Module: DataMapper::Model

Defined in:
lib/dm-adjust/model.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) adjust(*args)



4
5
6
# File 'lib/dm-adjust/model.rb', line 4

def adjust(*args)
  all.adjust(*args)
end

- (Object) adjust!(*args)

increment or decrement attributes on all objects in a resource

Examples:

Usage

* People.adjust(:salary => +1000)
* Children.adjust(:allowance => -100)

Parameters:

  • attributes (Hash)

    A hash of attributes to adjust, and their adjustment



17
18
19
# File 'lib/dm-adjust/model.rb', line 17

def adjust!(*args)
  all.adjust!(*args)
end