Module: Gluttonberg::Content::Workflow::ClassMethods
- Defined in:
- lib/gluttonberg/content/workflow.rb
Instance Method Summary collapse
-
#all_approved_and_published(options = {}) ⇒ Object
Returns all records with the approved state and additionally with the publish flag set.
-
#all_pending(options = {}) ⇒ Object
Returns all records with the pending state.
-
#all_rejected(options = {}) ⇒ Object
Returns all records with the rejected state.
Instance Method Details
#all_approved_and_published(options = {}) ⇒ Object
Returns all records with the approved state and additionally with the publish flag set. The publish flag is managed by the Publishable mixin, so obviously it need to be included in the model for this method to work.
Extra conditions can also be passed in.
44 45 46 47 |
# File 'lib/gluttonberg/content/workflow.rb', line 44 def all_approved_and_published( = {}) .merge!(:state => :approved , :published => true) all() end |
#all_pending(options = {}) ⇒ Object
Returns all records with the pending state. May take additional conditions.
26 27 28 29 |
# File 'lib/gluttonberg/content/workflow.rb', line 26 def all_pending( = {}) [:state] = :pending all() end |
#all_rejected(options = {}) ⇒ Object
Returns all records with the rejected state. May take additional conditions.
33 34 35 36 |
# File 'lib/gluttonberg/content/workflow.rb', line 33 def all_rejected( = {}) [:state] = :rejected all() end |