Class: Workflow
- Inherits:
-
WorkflowKit::Workflow
- Object
- WorkflowKit::Workflow
- Workflow
- Defined in:
- app/models/workflow.rb
Overview
< ActiveRecord::Base
Class Method Summary collapse
- .create_mark_as_deceased_workflow ⇒ Object
- .find_mark_as_deceased_workflow ⇒ Object
- .find_or_create_mark_as_deceased_workflow ⇒ Object
Instance Method Summary collapse
- #name_as_verb ⇒ Object
- #title ⇒ Object
-
#wah_group ⇒ Object
> TODO: corporation.
Class Method Details
.create_mark_as_deceased_workflow ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'app/models/workflow.rb', line 31 def self.create_mark_as_deceased_workflow raise 'Workflow already present.' if self.find_mark_as_deceased_workflow workflow = Workflow.create(name: "Todesfall") step = workflow.steps.build step.sequence_index = 1 step.brick_name = "MarkAsDeceasedBrick" step.save return workflow end |
.find_mark_as_deceased_workflow ⇒ Object
27 28 29 |
# File 'app/models/workflow.rb', line 27 def self.find_mark_as_deceased_workflow Workflow.where(name: "Todesfall").first end |
.find_or_create_mark_as_deceased_workflow ⇒ Object
23 24 25 |
# File 'app/models/workflow.rb', line 23 def self.find_or_create_mark_as_deceased_workflow self.find_mark_as_deceased_workflow || self.create_mark_as_deceased_workflow end |
Instance Method Details
#name_as_verb ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'app/models/workflow.rb', line 10 def name_as_verb # TODO: This is German only! Internationalize! name .gsub( /ung/, 'en' ) .gsub( /ation/, 'ieren' ) .downcase end |
#title ⇒ Object
6 7 8 |
# File 'app/models/workflow.rb', line 6 def title name end |
#wah_group ⇒ Object
> TODO: corporation
19 20 21 |
# File 'app/models/workflow.rb', line 19 def wah_group # => TODO: corporation ( self.ancestor_groups & Corporation.all ).first end |