Class: Decidim::ParticipatoryProcess
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Decidim::ParticipatoryProcess
- Includes:
- HasAttachments
- Defined in:
- app/models/decidim/participatory_process.rb
Overview
Interaction between a user and an organization is done via a ParticipatoryProcess. It’s a unit of action from the Organization point of view that groups several features (proposals, debates…) distributed in steps that get enabled or disabled depending on which step is currently active.
Class Method Summary collapse
-
.promoted ⇒ Object
Scope to return only the promoted processes.
-
.published ⇒ Object
Scope to return only the published processes.
Instance Method Summary collapse
- #hashtag ⇒ Object
-
#published? ⇒ Boolean
Checks whether the process has been published or not.
Class Method Details
.promoted ⇒ Object
Scope to return only the promoted processes.
Returns an ActiveRecord::Relation.
63 64 65 |
# File 'app/models/decidim/participatory_process.rb', line 63 def self.promoted where(promoted: true) end |
.published ⇒ Object
Scope to return only the published processes.
Returns an ActiveRecord::Relation.
56 57 58 |
# File 'app/models/decidim/participatory_process.rb', line 56 def self.published where.not(published_at: nil) end |
Instance Method Details
#hashtag ⇒ Object
74 75 76 |
# File 'app/models/decidim/participatory_process.rb', line 74 def hashtag attributes["hashtag"].to_s.delete("#") end |
#published? ⇒ Boolean
Checks whether the process has been published or not.
Returns a boolean.
70 71 72 |
# File 'app/models/decidim/participatory_process.rb', line 70 def published? published_at.present? end |