Module: Imparcial::Driver::AbstractExpression::Update

Included in:
Imparcial::Driver::AbstractExpression
Defined in:
lib/imparcial/driver/abstract/expression/update.rb

Instance Method Summary collapse

Instance Method Details

#update(options) ⇒ Object

Description

Update some records.

Usage

abstract_adapter.update :table_name => ‘person’, :values => => 1500, :conditions => [‘id = ?’,10]

Options

  • :table_name

  • :values

  • :conditions

Returning

nothing



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/imparcial/driver/abstract/expression/update.rb', line 31

def update ( options )
      
  check_options expected_options_for_updating, options

  sql = sql_for_updating( options )

  logger.warn sql if @update_logging
  
  query sql
  
rescue adapter_specific_exception => ex

  raise UpdateError.new(ex.message)

end