Sha256: 5eae87638a7b83166348a222abf991585819849086ed4098a50f0f81d103af6d
Contents?: true
Size: 673 Bytes
Versions: 13
Compression:
Stored size: 673 Bytes
Contents
# frozen_string_literal: true module Decidim module Initiatives # This query retrieves the organization prioritized initiatives that will appear in the homepage class OrganizationPrioritizedInitiatives < Decidim::Query attr_reader :organization, :order def initialize(organization, order) @organization = organization @order = order end def query if order == "most_recent" base_query.order_by_most_recently_published else base_query end end private def base_query Decidim::Initiative.where(organization:).published.open end end end end
Version data entries
13 entries across 13 versions & 1 rubygems