Class: Decidim::Initiatives::InitiativeTypes
- Inherits:
-
Query
- Object
- Query
- Decidim::Initiatives::InitiativeTypes
- Defined in:
- app/queries/decidim/initiatives/initiative_types.rb
Overview
Class uses to retrieve the available initiative types.
Class Method Summary collapse
-
.for(organization) ⇒ Object
Syntactic sugar to initialize the class and return the queried objects.
Instance Method Summary collapse
-
#initialize(organization) ⇒ InitiativeTypes
constructor
Initializes the class.
-
#query ⇒ Object
Retrieves the available initiative types for the given organization.
Constructor Details
#initialize(organization) ⇒ InitiativeTypes
Initializes the class.
organization - Decidim::Organization
17 18 19 |
# File 'app/queries/decidim/initiatives/initiative_types.rb', line 17 def initialize(organization) @organization = organization end |
Class Method Details
.for(organization) ⇒ Object
Syntactic sugar to initialize the class and return the queried objects.
organization - Decidim::Organization
10 11 12 |
# File 'app/queries/decidim/initiatives/initiative_types.rb', line 10 def self.for(organization) new(organization).query end |
Instance Method Details
#query ⇒ Object
Retrieves the available initiative types for the given organization.
22 23 24 |
# File 'app/queries/decidim/initiatives/initiative_types.rb', line 22 def query InitiativesType.where(organization: @organization) end |