1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00
aasm/spec/models/namespaced_multiple_example.rb

29 lines
619 B
Ruby
Raw Normal View History

class NamespacedMultipleExample
include AASM
aasm(:status) do
state :unapproved, :initial => true
state :approved
event :approve do
transitions :from => :unapproved, :to => :approved
end
event :unapprove do
transitions :from => :approved, :to => :unapproved
end
end
aasm(:review_status, namespace: :review) do
state :unapproved, :initial => true
state :approved
event :approve_review do
transitions :from => :unapproved, :to => :approved
end
event :unapprove_review do
transitions :from => :approved, :to => :unapproved
end
end
end