From 5011d4745bdc5dc2bc64a33400f89a2cfa7492b3 Mon Sep 17 00:00:00 2001 From: taitus Date: Wed, 7 Sep 2022 13:41:26 +0200 Subject: [PATCH] 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. --- app/controllers/admin/poll/polls_controller.rb | 9 --------- app/models/abilities/administrator.rb | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/app/controllers/admin/poll/polls_controller.rb b/app/controllers/admin/poll/polls_controller.rb index 8cfa00136..5e9c84c90 100644 --- a/app/controllers/admin/poll/polls_controller.rb +++ b/app/controllers/admin/poll/polls_controller.rb @@ -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 diff --git a/app/models/abilities/administrator.rb b/app/models/abilities/administrator.rb index 0f492cd0b..44201bdf4 100644 --- a/app/models/abilities/administrator.rb +++ b/app/models/abilities/administrator.rb @@ -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