Sha256: 91458a8184e333208b43be173cc02a753abdf6b6cb620d5b5d035ca85520f2db
Contents?: true
Size: 686 Bytes
Versions: 12
Compression:
Stored size: 686 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: organization).published.open end end end end
Version data entries
12 entries across 12 versions & 1 rubygems