Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
mikel committed Jan 14, 2010
1 parent 23e434f commit d1bedd1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions activemodel/README
Expand Up @@ -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']}

0 comments on commit d1bedd1

Please sign in to comment.