APIdock / Ruby on Rails
/
Browse About
method

restore_*!

v7.1.3.4 - Show latest stable - Class: ActiveModel::Dirty
restore_*!
public

This method is generated for each attribute.

Restores the attribute to the old value.

person = Person.new
person.name = 'Amanda'
person.restore_name!
person.name # => nil
# File activemodel/lib/active_model/dirty.rb, line 228

Related methods

  • Instance methods
  • *_change
  • *_changed?
  • *_previous_change
  • *_previously_changed?
  • *_previously_was
  • *_was
  • *_will_change!
  • as_json
  • attribute_changed?
  • attribute_changed_in_place?
  • attribute_previously_changed?
  • attribute_previously_was
  • attribute_was
  • changed
  • changed?
  • changed_attributes
  • changes
  • changes_applied
  • clear_attribute_changes
  • clear_changes_information
  • initialize_dup
  • previous_changes
  • restore_*!
  • restore_attributes
  • Private methods
  • privateattribute_change
  • privateattribute_previous_change
  • privateattribute_will_change!
  • privateclear_attribute_change
  • privateforget_attribute_assignments
  • privateinit_internals
  • privatemutations_before_last_save
  • privatemutations_from_database
  • privaterestore_attribute!
APIdock API Documentation Browser

© 2026 APIdock