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 commit20e31133afor :search_booths and commit19ec7f93bfor :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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user