APIdock / Ruby on Rails
/
Browse About
method

restore_attribute!

v5.2.3 - Show latest stable - Class: ActiveModel::Dirty
restore_attribute!(attr)
private

Handles restore_*! for method_missing.

# File activemodel/lib/active_model/dirty.rb, line 327
      def restore_attribute!(attr)
        if attribute_changed?(attr)
          __send__("#{attr}=", changed_attributes[attr])
          clear_attribute_changes([attr])
        end
      end

Related methods

  • Instance methods
  • attribute_changed?
  • attribute_changed_in_place?
  • attribute_previously_changed?
  • attribute_was
  • changed
  • changed?
  • changed_attributes
  • changes
  • changes_applied
  • clear_attribute_changes
  • clear_changes_information
  • initialize_dup
  • previous_changes
  • restore_attributes
  • Private methods
  • privateattribute_change
  • privateattribute_changed_by_setter?
  • privateattribute_previous_change
  • privateattribute_will_change!
  • privateattributes_changed_by_setter
  • privatecache_changed_attributes
  • privatechanges_include?
  • privateclear_attribute_change
  • privateclear_changed_attributes_cache
  • privateforget_attribute_assignments
  • privatemutations_before_last_save
  • privatemutations_from_database
  • privateprevious_changes_include?
  • privaterestore_attribute!
  • privateset_attribute_was
APIdock API Documentation Browser

Track DORA metrics effortlessly with Swarmia.

© 2026 APIdock