From eb05774531ffef41f3919dabb5b5a3a4ea723a04 Mon Sep 17 00:00:00 2001 From: Daniele Di Bernardo Date: Thu, 6 Nov 2014 19:56:20 +0100 Subject: [Enh] Changed the visibility of the ActiveModel::Dirty#clear_attribute_changes method In Rails 4.2 it is impossible to define a custom default value for a model's attribute without making it appear as _changed?, especially when the model is first initialized. Making this method publicly visible will allow such a behaviour, without the need to use private APIs. --- activemodel/lib/active_model/dirty.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activemodel/lib/active_model/dirty.rb b/activemodel/lib/active_model/dirty.rb index ae185694ca..4e389c8692 100644 --- a/activemodel/lib/active_model/dirty.rb +++ b/activemodel/lib/active_model/dirty.rb @@ -255,7 +255,7 @@ module ActiveModel end # Remove changes information for the provided attributes. - def clear_attribute_changes(attributes) + def clear_attribute_changes(attributes) # :doc: attributes_changed_by_setter.except!(*attributes) end end -- cgit v1.2.3