aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activemodel/README19
1 files changed, 19 insertions, 0 deletions
diff --git a/activemodel/README b/activemodel/README
index c0d59f7208..46f02aa651 100644
--- a/activemodel/README
+++ b/activemodel/README
@@ -39,3 +39,22 @@ You can include functionality from the following modules:
...returns the class itself when sent :to_model
+* Tracking changes in your object
+
+ class MyClass
+ include ActiveModel::Dirty
+
+ end
+
+ ...provides all the value tracking features implemented by ActiveRecord
+
+ person.name # => 'bill'
+ person.changed? # => false
+ person.name = 'bob'
+ person.changed? # => true
+ person.changed # => ['name']
+ person.changes # => { 'name' => ['bill', 'bob'] }
+ person.name = 'robert'
+ person.save
+ person.previous_changes # => {'name' => ['bob, 'robert']}
+ \ No newline at end of file