README.md in mongoid-undo-0.9.1 vs README.md in mongoid-undo-0.10.0
- old
+ new
@@ -62,10 +62,27 @@
document.redo
document.persisted? #=> false
```
+### Callbacks
+
+Mongoid::Undo defines two callbacks which are called before and after `undo`, respectively `redo`. Both are based on `ActiveModel::Callbacks`which means they behave like the allready known Rails callbacks.
+
+```ruby
+class Document
+ include Mongoid::Document
+ include Mongoid::Undo
+
+ before_undo do
+ # Do something fancy.
+ end
+
+ before_redo { false } # Don't allow redoing.
+```
+
+
## Installation
In your Gemfile:
```ruby
@@ -77,9 +94,10 @@
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
+
## Copyright
(The MIT license)