aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorIan Stewart <istewart@me.com>2011-06-28 22:18:24 -0700
committerIan Stewart <istewart@me.com>2011-06-28 22:18:24 -0700
commiteafa174bfdeef943669332b67d87078b9b88e02d (patch)
tree1261787801779d58c2a41fa6b090fc5379f82709 /activemodel/lib
parent31536855ae90bf2fb07c855d05837246b5aa6fb9 (diff)
downloadrails-eafa174bfdeef943669332b67d87078b9b88e02d.tar.gz
rails-eafa174bfdeef943669332b67d87078b9b88e02d.tar.bz2
rails-eafa174bfdeef943669332b67d87078b9b88e02d.zip
changing an attribute multiple times retains the correct original value
Diffstat (limited to 'activemodel/lib')
-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 3b412d3dd7..166cccf161 100644
--- a/activemodel/lib/active_model/dirty.rb
+++ b/activemodel/lib/active_model/dirty.rb
@@ -156,7 +156,7 @@ module ActiveModel
rescue TypeError, NoMethodError
end
- changed_attributes[attr] = value
+ changed_attributes[attr] = value unless changed_attributes.include?(attr)
end
# Handle <tt>reset_*!</tt> for +method_missing+.