Skip to content

Instantly share code, notes, and snippets.

@mileszs
Last active December 12, 2015 10:08
Show Gist options
  • Select an option

  • Save mileszs/4756519 to your computer and use it in GitHub Desktop.

Select an option

Save mileszs/4756519 to your computer and use it in GitHub Desktop.
include Workflow
workflow do
state :in_progress do
event :publish, transitions_to: :awaiting_review
end
state :awaiting_review do
event :sent, transitions_to: :being_reviewed
end
state :being_reviewed do
event :reviewed_and_archived, transitions_to: :archived
event :reviewed_needing_revisions, transitions_to: :being_revised
end
state :being_revised do
event :republished, transitions_to: :being_rereviewed
end
state :being_rereviewed do
event :rereviewed, transitions_to :archived
end
state :archived
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment