Skip to content

Instantly share code, notes, and snippets.

@srbiv
Created May 10, 2012 16:31
Show Gist options
  • Save srbiv/2654322 to your computer and use it in GitHub Desktop.
Save srbiv/2654322 to your computer and use it in GitHub Desktop.
state_machine :state, intial: :active do
event :free_trial_signed_up do
transition all => :free_trial
end
event :account_created do
transition all => :active
end
event :free_trial_lapsed do
transition :free_trial => :abandoned
end
event :contract_lapsed do
transition :active => :lapsed
end
event :contract_expired do
transition :lapsed => :inactive
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment