Sha256: f697054de735086c96baa65603d74d9b6ccba5847609dd030b44edd315b941f5

Contents?: true

Size: 602 Bytes

Versions: 6

Compression:

Stored size: 602 Bytes

Contents

module DataMapper
  module Model

    def adjust(attributes = {}, reload = false)
      raise NotImplementedError, 'adjust *with* validations has not be written yet, try adjust!'
    end

    ##
    # increment or decrement attributes on all objects in a resource
    #
    # @example [Usage]
    #   * People.adjust(:salary => +1000)
    #   * Children.adjust(:allowance => -100)
    #
    # @param attributes <Hash> A hash of attributes to adjust, and their adjustment
    # @public
    def adjust!(attributes,reload=false)
      all.adjust!(attributes,reload)
    end
  end # Model
end # DataMapper

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dm-adjust-0.10.1 lib/dm-adjust/model.rb
dm-adjust-0.10.0 lib/dm-adjust/model.rb
dm-adjust-0.9.11 lib/dm-adjust/model.rb
dm-adjust-0.9.10 lib/dm-adjust/model.rb
dm-adjust-0.9.8 lib/dm-adjust/model.rb
dm-adjust-0.9.9 lib/dm-adjust/model.rb