Module: RailsWorkflow::Status::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#all_statusesObject



8
9
10
# File 'app/concerns/rails_workflow/status.rb', line 8

def all_statuses
  (NOT_STARTED..ROLLBACK).to_a
end

#get_status_code(status) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/concerns/rails_workflow/status.rb', line 12

def get_status_code status
  case status
    when "in_progress"
      IN_PROGRESS
    when "done"
      DONE
    when "not_started"
      NOT_STARTED
    when "waiting"
      WAITING
    when "error"
      ERROR
  end
end