From 41fb06fa47b0c11d6b943163ec1bc8ce9fd4d229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 15 Jul 2014 16:12:23 -0300 Subject: Deprecate `reset_#{attribute}` in favor of `restore_#{attribute}`. These methods may cause confusion with the `reset_changes` that behaves differently of them. Also rename undo_changes to restore_changes to match this new set of methods. --- activemodel/test/cases/dirty_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'activemodel/test') diff --git a/activemodel/test/cases/dirty_test.rb b/activemodel/test/cases/dirty_test.rb index 09f26c319d..6b8bb5216b 100644 --- a/activemodel/test/cases/dirty_test.rb +++ b/activemodel/test/cases/dirty_test.rb @@ -51,7 +51,7 @@ class DirtyTest < ActiveModel::TestCase end def rollback - undo_changes + restore_attributes end end @@ -115,7 +115,7 @@ class DirtyTest < ActiveModel::TestCase test "resetting attribute" do @model.name = "Bob" - @model.reset_name! + @model.restore_name! assert_nil @model.name assert !@model.name_changed? end @@ -202,7 +202,7 @@ class DirtyTest < ActiveModel::TestCase assert_equal ActiveSupport::HashWithIndifferentAccess.new, @model.changed_attributes end - test "undo_changes should restore all previous data" do + test "restore_attributes should restore all previous data" do @model.name = 'Dmitry' @model.color = 'Red' @model.save -- cgit v1.2.3