Sha256: 2b1e97a0c0c56f23dd2d480198906657a66d48f6e0b33ca410e1e6b9e9b01a87

Contents?: true

Size: 752 Bytes

Versions: 7

Compression:

Stored size: 752 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Votings
    module PollingOfficerZone
      # Exposes the polling officer zone for polling officer users
      class PollingOfficersController < Decidim::Votings::PollingOfficerZone::ApplicationController
        helper Decidim::Admin::IconLinkHelper
        helper Decidim::ResourceHelper

        helper_method :polling_stations, :polling_officers_elections

        def index
          enforce_permission_to :view, :polling_officers, polling_officers:
        end

        private

        def polling_officers_elections
          @polling_officers_elections ||= polling_officers.flat_map { |polling_officer| polling_officer.voting.published_elections }
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-elections-0.28.4 app/controllers/decidim/votings/polling_officer_zone/polling_officers_controller.rb
decidim-elections-0.28.3 app/controllers/decidim/votings/polling_officer_zone/polling_officers_controller.rb
decidim-elections-0.28.2 app/controllers/decidim/votings/polling_officer_zone/polling_officers_controller.rb
decidim-elections-0.28.1 app/controllers/decidim/votings/polling_officer_zone/polling_officers_controller.rb
decidim-elections-0.28.0 app/controllers/decidim/votings/polling_officer_zone/polling_officers_controller.rb
decidim-elections-0.28.0.rc5 app/controllers/decidim/votings/polling_officer_zone/polling_officers_controller.rb
decidim-elections-0.28.0.rc4 app/controllers/decidim/votings/polling_officer_zone/polling_officers_controller.rb