Updated README

This commit is contained in:
Mikel Lindsaar 2010-01-15 10:01:40 +11:00
parent 23e434f08f
commit d1bedd182b
1 changed files with 19 additions and 0 deletions

View File

@ -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']}