提交 d1bedd18 编写于 作者: M Mikel Lindsaar

Updated README

上级 23e434f0
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册