Class: Decidim::ParticipatoryProcess

Inherits:
ApplicationRecord show all
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

Instance Method Summary collapse

Class Method Details

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

.publishedObject

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

#hashtagObject



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.

Returns:

  • (Boolean)


70
71
72
# File 'app/models/decidim/participatory_process.rb', line 70

def published?
  published_at.present?
end