Sha256: a10a783087ea978c749f9ed8fd76728448be614906f7f0caf48c698245b9cf69

Contents?: true

Size: 1.06 KB

Versions: 19

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

module Decidim
  module Votings
    module Admin
      # A class join the polling officers with their respective polling stations and users.
      class PollingOfficersJoinPollingStationsAndUser < Decidim::Query
        # Syntactic sugar to initialize the class and return the queried objects.
        #
        # polling_officers - the collection of polling officers
        def self.for(polling_officers)
          new(polling_officers).query
        end

        # Initializes the class.
        #
        # polling_officers - the collection of polling officers
        def initialize(polling_officers)
          @polling_officers = polling_officers
        end

        # Finds joins the polling officers with their associated polling stations and users.
        #
        # Returns an ActiveRecord::Relation.
        def query
          Decidim::Query.merge(
            PollingOfficersJoinPollingStations.new(@polling_officers),
            PollingOfficersJoinUser.new(@polling_officers)
          ).query
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
decidim-elections-0.28.4 app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb
decidim-elections-0.27.9 app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb
decidim-elections-0.28.3 app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb
decidim-elections-0.27.8 app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb
decidim-elections-0.28.2 app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb
decidim-elections-0.27.7 app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb
decidim-elections-0.28.1 app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb
decidim-elections-0.27.6 app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb
decidim-elections-0.28.0 app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb
decidim-elections-0.27.5 app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb
decidim-elections-0.28.0.rc5 app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb
decidim-elections-0.28.0.rc4 app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb
decidim-elections-0.27.4 app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb
decidim-elections-0.27.3 app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb
decidim-elections-0.27.2 app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb
decidim-elections-0.27.1 app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb
decidim-elections-0.27.0 app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb
decidim-elections-0.27.0.rc2 app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb
decidim-elections-0.27.0.rc1 app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb