aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorFederico Brubacher <fbrubacher@gmail.com>2010-05-16 07:24:41 -0300
committerJosé Valim <jose.valim@gmail.com>2010-05-16 23:04:40 +0200
commit6b4e0cc526f55b5532cf99292c94f0a4db53b16f (patch)
tree3a01741b220863bcd701f0b00e6ce0145cb33f06 /activemodel
parentade756fe42423033bae8e5aea8f58782f7a6c517 (diff)
downloadrails-6b4e0cc526f55b5532cf99292c94f0a4db53b16f.tar.gz
rails-6b4e0cc526f55b5532cf99292c94f0a4db53b16f.tar.bz2
rails-6b4e0cc526f55b5532cf99292c94f0a4db53b16f.zip
a cloned object no longer mimics changed flags from creator , plus a test case [#4614 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/dirty.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/activemodel/lib/active_model/dirty.rb b/activemodel/lib/active_model/dirty.rb
index a7ee15a7f6..bbcc345e4b 100644
--- a/activemodel/lib/active_model/dirty.rb
+++ b/activemodel/lib/active_model/dirty.rb
@@ -124,11 +124,12 @@ module ActiveModel
@previously_changed
end
+ # Map of change <tt>attr => original value</tt>.
+ def changed_attributes
+ @changed_attributes ||= {}
+ end
+
private
- # Map of change <tt>attr => original value</tt>.
- def changed_attributes
- @changed_attributes ||= {}
- end
# Handle <tt>*_changed?</tt> for +method_missing+.
def attribute_changed?(attr)