Module: ActiveRecord::Persistence
- Defined in:
- lib/update_if_changed.rb
Instance Method Summary collapse
Instance Method Details
#update_if_changed(attributes) ⇒ Object
3 4 5 6 |
# File 'lib/update_if_changed.rb', line 3 def update_if_changed(attributes) self.assign_attributes(attributes) self.update(attributes) if self.changed? end |