aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/dirty.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/dirty.rb b/activemodel/lib/active_model/dirty.rb
index 2f6b30dfed..57c594f159 100644
--- a/activemodel/lib/active_model/dirty.rb
+++ b/activemodel/lib/active_model/dirty.rb
@@ -86,6 +86,11 @@ module ActiveModel
attribute_method_affix :prefix => 'reset_', :suffix => '!'
end
+ def initialize(*)
+ @changed_attributes = {}
+ super
+ end
+
# Do any attributes have unsaved changes?
# person.changed? # => false
# person.name = 'bob'