Module: ActiveRecord::Persistence
- Defined in:
- lib/spree_core/ext/active_record.rb
Instance Method Summary collapse
-
#update_attribute_without_callbacks(name, value) ⇒ Object
Update a single attribute in the database.
-
#update_attributes_without_callbacks(attributes) ⇒ Object
Update attributes of a record in the database without callbacks, validations etc.
Instance Method Details
#update_attribute_without_callbacks(name, value) ⇒ Object
Update a single attribute in the database
10 11 12 13 |
# File 'lib/spree_core/ext/active_record.rb', line 10 def update_attribute_without_callbacks(name, value) send("#{name}=", value) update_attributes_without_callbacks(name => value) end |
#update_attributes_without_callbacks(attributes) ⇒ Object
Update attributes of a record in the database without callbacks, validations etc.
4 5 6 7 |
# File 'lib/spree_core/ext/active_record.rb', line 4 def update_attributes_without_callbacks(attributes) self.send(:attributes=, attributes, false) self.class.update_all(attributes, { :id => id }) end |