mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
35 lines
549 B
Ruby
35 lines
549 B
Ruby
class FalseState < ActiveRecord::Base
|
|
include AASM
|
|
|
|
def initialize(*args)
|
|
super
|
|
self.aasm_state = false
|
|
end
|
|
|
|
aasm do
|
|
state :opened
|
|
state :closed
|
|
|
|
event :view do
|
|
transitions :to => :read, :from => [:needs_attention]
|
|
end
|
|
end
|
|
end
|
|
|
|
class MultipleFalseState < ActiveRecord::Base
|
|
include AASM
|
|
|
|
def initialize(*args)
|
|
super
|
|
self.aasm_state = false
|
|
end
|
|
|
|
aasm :left do
|
|
state :opened
|
|
state :closed
|
|
|
|
event :view do
|
|
transitions :to => :read, :from => [:needs_attention]
|
|
end
|
|
end
|
|
end
|