mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
Merge pull request #36 from ramn/master
Documentation for callbacks around events
This commit is contained in:
commit
44c44538e7
1 changed files with 17 additions and 0 deletions
17
README.md
17
README.md
|
@ -117,6 +117,23 @@ This example uses a few of the more complex features available.
|
|||
end
|
||||
```
|
||||
|
||||
## Callbacks around events
|
||||
```ruby
|
||||
class Relationship
|
||||
include AASM
|
||||
|
||||
aasm_state :dating
|
||||
aasm_state :married
|
||||
|
||||
aasm_event :get_married,
|
||||
:before => :make_vows,
|
||||
:after => :eat_wedding_cake do
|
||||
transitions :to => :married, :from => [:dating]
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
# Other Stuff #
|
||||
|
||||
Author:: Scott Barron <scott at elitists dot net>
|
||||
|
|
Loading…
Reference in a new issue