Created
August 23, 2009 02:02
-
-
Save ajsharp/173090 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include AASM | |
include AASM::Persistence | |
aasm_column :status | |
aasm_initial_state Proc.new { |task| task.assignments.empty? ? :not_started } | |
aasm_state :not_started | |
aasm_state :in_progress | |
aasm_state :completed | |
aasm_event :start_task do | |
transitions :to => :in_progress, :from => :not_started | |
end | |
aasm_event :complete_task do | |
transitions :to => :completed, :from => :in_progress | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment