Module: RailsWorkflow::Status::ClassMethods

Defined in:
app/concerns/rails_workflow/status.rb

Instance Method Summary collapse

Instance Method Details

#all_statusesObject



18
19
20
# File 'app/concerns/rails_workflow/status.rb', line 18

def all_statuses
  (NOT_STARTED..ROLLBACK).to_a
end

#status_code_for(status) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'app/concerns/rails_workflow/status.rb', line 22

def status_code_for(status)
  [
    ['in_progress', IN_PROGRESS],
    ['done', DONE],
    ['not_started', NOT_STARTED],
    ['waiting', WAITING],
    ['error', ERROR]
  ].assoc(status).last
end

#uncompleted_statusesObject



32
33
34
# File 'app/concerns/rails_workflow/status.rb', line 32

def uncompleted_statuses
  [NOT_STARTED, IN_PROGRESS, WAITING]
end