mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
Fix misleading example which uses a 'new' state.
A state called 'new' would currently not work with activerecord.
This commit is contained in:
parent
82c3202da3
commit
656984f8b2
1 changed files with 4 additions and 4 deletions
|
@ -41,19 +41,19 @@ Here's a quick example highlighting some of the features.
|
|||
class Conversation
|
||||
include AASM
|
||||
|
||||
aasm_initial_state :new
|
||||
aasm_initial_state :unread
|
||||
|
||||
aasm_state :new
|
||||
aasm_state :unread
|
||||
aasm_state :read
|
||||
aasm_state :closed
|
||||
|
||||
|
||||
aasm_event :view do
|
||||
transitions :to => :read, :from => [:new]
|
||||
transitions :to => :read, :from => [:unread]
|
||||
end
|
||||
|
||||
aasm_event :close do
|
||||
transitions :to => :closed, :from => [:read, :new]
|
||||
transitions :to => :closed, :from => [:read, :unread]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue