Module: Gluttonberg::Content::Workflow::ClassMethods
- Defined in:
- lib/gluttonberg/content/workflow.rb
Instance Method Summary (collapse)
-
- (Object) all_approved_and_published(options = {})
Returns all records with the approved state and additionally with the publish flag set.
-
- (Object) all_pending(options = {})
Returns all records with the pending state.
-
- (Object) all_rejected(options = {})
Returns all records with the rejected state.
Instance Method Details
- (Object) all_approved_and_published(options = {})
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 |
- (Object) all_pending(options = {})
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 |
- (Object) all_rejected(options = {})
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 |