Module: WorkflowStatus
- Defined in:
- lib/workflow_status.rb,
lib/workflow_status/version.rb
Defined Under Namespace
Modules: InstanceMethods
Constant Summary collapse
- WORKFLOW_STATUS_MAP =
{ unpublished: 0, published: 1, trashed: 2 }
- VERSION =
"0.0.3"
Class Method Summary collapse
Instance Method Summary collapse
- #published ⇒ Object
-
#status_options_for_select ⇒ Object
for Rails form select helper.
- #trashed ⇒ Object
- #unpublished ⇒ Object
- #workflow_statuses ⇒ Object
Class Method Details
.extended(extender) ⇒ Object
12 13 14 |
# File 'lib/workflow_status.rb', line 12 def extended(extender) extender.send :include, InstanceMethods end |
Instance Method Details
#published ⇒ Object
25 26 27 |
# File 'lib/workflow_status.rb', line 25 def published where(workflow_status: workflow_status_code(:published)) end |
#status_options_for_select ⇒ Object
for Rails form select helper
35 36 37 |
# File 'lib/workflow_status.rb', line 35 def workflow_status_map.to_a end |
#trashed ⇒ Object
29 30 31 |
# File 'lib/workflow_status.rb', line 29 def trashed where(workflow_status: workflow_status_code(:trashed)) end |
#unpublished ⇒ Object
21 22 23 |
# File 'lib/workflow_status.rb', line 21 def unpublished where(workflow_status: workflow_status_code(:unpublished)) end |
#workflow_statuses ⇒ Object
17 18 19 |
# File 'lib/workflow_status.rb', line 17 def workflow_statuses workflow_status_map.keys end |