Class: Decidim::Initiatives::OrganizationPrioritizedInitiatives
- Inherits:
-
Query
- Object
- Query
- Decidim::Initiatives::OrganizationPrioritizedInitiatives
- Defined in:
- app/queries/decidim/initiatives/organization_prioritized_initiatives.rb
Overview
This query retrieves the organization prioritized initiatives that will appear in the homepage
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
Instance Method Summary collapse
-
#initialize(organization, order) ⇒ OrganizationPrioritizedInitiatives
constructor
A new instance of OrganizationPrioritizedInitiatives.
- #query ⇒ Object
Constructor Details
#initialize(organization, order) ⇒ OrganizationPrioritizedInitiatives
Returns a new instance of OrganizationPrioritizedInitiatives.
9 10 11 12 |
# File 'app/queries/decidim/initiatives/organization_prioritized_initiatives.rb', line 9 def initialize(organization, order) @organization = organization @order = order end |
Instance Attribute Details
#order ⇒ Object (readonly)
Returns the value of attribute order.
7 8 9 |
# File 'app/queries/decidim/initiatives/organization_prioritized_initiatives.rb', line 7 def order @order end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
7 8 9 |
# File 'app/queries/decidim/initiatives/organization_prioritized_initiatives.rb', line 7 def organization @organization end |
Instance Method Details
#query ⇒ Object
14 15 16 17 18 19 20 |
# File 'app/queries/decidim/initiatives/organization_prioritized_initiatives.rb', line 14 def query if order == "most_recent" base_query.order_by_most_recently_published else base_query end end |