aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-06-29 02:48:55 -0700
committerJosé Valim <jose.valim@gmail.com>2011-06-29 02:48:55 -0700
commit4106245530bc573c035fe70e8fc8633e89741abd (patch)
tree1261787801779d58c2a41fa6b090fc5379f82709 /activemodel/lib
parent31536855ae90bf2fb07c855d05837246b5aa6fb9 (diff)
parenteafa174bfdeef943669332b67d87078b9b88e02d (diff)
downloadrails-4106245530bc573c035fe70e8fc8633e89741abd.tar.gz
rails-4106245530bc573c035fe70e8fc8633e89741abd.tar.bz2
rails-4106245530bc573c035fe70e8fc8633e89741abd.zip
Merge pull request #1897 from istewart/active_model_dirty_patch
ActiveModel::Dirty patch for multiple assignments to the same attribute
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+.