aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniele Di Bernardo <daniele.dib@gmail.com>2014-11-06 19:56:20 +0100
committerDaniele Di Bernardo <daniele.dib@gmail.com>2014-11-06 19:56:20 +0100
commiteb05774531ffef41f3919dabb5b5a3a4ea723a04 (patch)
treeb8f36c5eec87061966fff0ded17f242542e52c67
parent300c96ce158a6ebd3a83b057a8cdf2d29de0fe9d (diff)
downloadrails-eb05774531ffef41f3919dabb5b5a3a4ea723a04.tar.gz
rails-eb05774531ffef41f3919dabb5b5a3a4ea723a04.tar.bz2
rails-eb05774531ffef41f3919dabb5b5a3a4ea723a04.zip
[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.
-rw-r--r--activemodel/lib/active_model/dirty.rb2
1 files changed, 1 insertions, 1 deletions
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