Remove related code for unused actions from admin polls controller

Actions :search_booths and :search_officers in admin polls controller
are moved to other controllers since commit 20e31133a for
:search_booths and commit 19ec7f93b for :search_officers.

This then allows us to remove the code that references these actions in
the controller and in the administrator abilities.
This commit is contained in:
taitus
2022-09-07 13:41:26 +02:00
parent b9d63bc2ab
commit 5011d4745b
2 changed files with 1 additions and 10 deletions

View File

@@ -4,7 +4,6 @@ class Admin::Poll::PollsController < Admin::Poll::BaseController
include ReportAttributes
load_and_authorize_resource
before_action :load_search, only: [:search_booths, :search_officers]
before_action :load_geozones, only: [:new, :create, :edit, :update]
def index
@@ -86,14 +85,6 @@ class Admin::Poll::PollsController < Admin::Poll::BaseController
[*attributes, *report_attributes, translation_params(Poll)]
end
def search_params
params.permit(:poll_id, :search)
end
def load_search
@search = search_params[:search]
end
def resource
@poll ||= Poll.find(params[:id])
end

View File

@@ -83,7 +83,7 @@ module Abilities
can [:index, :create, :update, :destroy], Geozone
can [:read, :create, :update, :destroy, :add_question, :search_booths, :search_officers, :booth_assignments], Poll
can [:read, :create, :update, :destroy, :add_question, :booth_assignments], Poll
can [:read, :create, :update, :destroy, :available], Poll::Booth
can [:search, :create, :index, :destroy], ::Poll::Officer
can [:create, :destroy, :manage], ::Poll::BoothAssignment