Class: Decidim::Votings::OrganizationPrioritizedVotings

Inherits:
Rectify::Query
  • Object
show all
Defined in:
decidim-elections/app/queries/decidim/votings/organization_prioritized_votings.rb

Overview

This query class filters public votings given an organization in a meaningful prioritized order.

Instance Method Summary collapse

Constructor Details

#initialize(organization, user = nil) ⇒ OrganizationPrioritizedVotings

Returns a new instance of OrganizationPrioritizedVotings.


8
9
10
11
# File 'decidim-elections/app/queries/decidim/votings/organization_prioritized_votings.rb', line 8

def initialize(organization, user = nil)
  @organization = organization
  @user = user
end

Instance Method Details

#queryObject


13
14
15
16
17
18
# File 'decidim-elections/app/queries/decidim/votings/organization_prioritized_votings.rb', line 13

def query
  Rectify::Query.merge(
    OrganizationPublishedVotings.new(@organization),
    PrioritizedVotings.new
  ).query
end