Remove unused go_back_to_new calls and unused error_create key
- Remove two redundant go_back_to_new calls in build_results, since
@poll.questions.find already raises RecordNotFound if a question
does not exist.
- Drop the fallback flash translation error_create, which is no longer
used since commit 592fdffe4e and only remained as a default in
go_back_to_new.
- Move check_officer_assignment from Officing::BaseController to
Officing::ResultsController, its only place of use.
This commit is contained in:
@@ -13,12 +13,6 @@ class Officing::BaseController < ApplicationController
|
||||
raise CanCan::AccessDenied unless current_user&.poll_officer?
|
||||
end
|
||||
|
||||
def check_officer_assignment
|
||||
if @officer_assignment.blank?
|
||||
go_back_to_new(t("officing.results.flash.error_wrong_booth"))
|
||||
end
|
||||
end
|
||||
|
||||
def load_officer_assignment
|
||||
@officer_assignments ||= current_user.poll_officer.officer_assignments.where(date: Time.current.to_date)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user