Class: Decidim::Sortitions::Admin::ParticipatorySpaceProposalComponents
- Inherits:
-
Query
- Object
- Query
- Decidim::Sortitions::Admin::ParticipatorySpaceProposalComponents
- Defined in:
- app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
Overview
Query that retrieves a list of proposal components
Instance Attribute Summary collapse
-
#participatory_space ⇒ Object
readonly
Returns the value of attribute participatory_space.
Class Method Summary collapse
-
.for(participatory_space) ⇒ Object
Sugar syntax.
Instance Method Summary collapse
-
#initialize(participatory_space) ⇒ ParticipatorySpaceProposalComponents
constructor
Initializes the query.
- #query ⇒ Object
Constructor Details
#initialize(participatory_space) ⇒ ParticipatorySpaceProposalComponents
Initializes the query
17 18 19 |
# File 'app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb', line 17 def initialize(participatory_space) @participatory_space = participatory_space end |
Instance Attribute Details
#participatory_space ⇒ Object (readonly)
Returns the value of attribute participatory_space.
8 9 10 |
# File 'app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb', line 8 def participatory_space @participatory_space end |
Class Method Details
.for(participatory_space) ⇒ Object
Sugar syntax. Allow retrieving all proposal components for the given participatory space.
12 13 14 |
# File 'app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb', line 12 def self.for(participatory_space) new(participatory_space).query end |
Instance Method Details
#query ⇒ Object
21 22 23 24 25 |
# File 'app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb', line 21 def query Component .where(participatory_space:, manifest_name: "proposals") .published end |