aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/dirty.rb11
1 files changed, 2 insertions, 9 deletions
diff --git a/activemodel/lib/active_model/dirty.rb b/activemodel/lib/active_model/dirty.rb
index 5f02929a9d..cb70cf74ee 100644
--- a/activemodel/lib/active_model/dirty.rb
+++ b/activemodel/lib/active_model/dirty.rb
@@ -116,19 +116,12 @@ module ActiveModel
# person.save
# person.previous_changes # => {'name' => ['bob, 'robert']}
def previous_changes
- previously_changed_attributes
+ @previously_changed
end
private
# Map of change <tt>attr => original value</tt>.
- def changed_attributes
- @changed_attributes ||= {}
- end
-
- # Map of fields that were changed when the model was saved
- def previously_changed_attributes
- @previously_changed || {}
- end
+ attr_reader :changed_attributes
# Handle <tt>*_changed?</tt> for +method_missing+.
def attribute_changed?(attr)