From ea5af622b665b2e2ab2663759695e6ce15de233d Mon Sep 17 00:00:00 2001 From: Daniel Dye Date: Thu, 31 Oct 2024 13:18:10 +0000 Subject: [PATCH 1/2] Address Rails/ActionControllerFlashBeforeRender violations --- app/controllers/publish/users_check_controller.rb | 3 +-- app/controllers/publish/users_edit_check_controller.rb | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/controllers/publish/users_check_controller.rb b/app/controllers/publish/users_check_controller.rb index a81276fe9f..4e56ae4a3b 100644 --- a/app/controllers/publish/users_check_controller.rb +++ b/app/controllers/publish/users_check_controller.rb @@ -11,8 +11,7 @@ def update return unless @user_form.save! UserAssociationsService::Create.call(user: @user_form.model, provider:) if @user_form.model.providers.exclude?(provider) - redirect_to publish_provider_users_path(params[:provider_code]) - flash[:success] = 'User added' + redirect_to publish_provider_users_path(params[:provider_code]), flash: { success: 'User added' } end private diff --git a/app/controllers/publish/users_edit_check_controller.rb b/app/controllers/publish/users_edit_check_controller.rb index d1e4b07064..47258040c8 100644 --- a/app/controllers/publish/users_edit_check_controller.rb +++ b/app/controllers/publish/users_edit_check_controller.rb @@ -11,8 +11,7 @@ def update return unless @user_form.save! UserAssociationsService::Create.call(user: @user_form.model, provider:) if @user_form.model.providers.exclude?(provider) - redirect_to publish_provider_user_path(id: params[:user_id]) - flash[:success] = 'User updated' + redirect_to publish_provider_user_path(id: params[:user_id]), flash: { success: 'User updated' } end private From 9c9dfc1781337942322418cc3f1d50e96598868c Mon Sep 17 00:00:00 2001 From: Daniel Dye Date: Thu, 31 Oct 2024 10:59:54 +0000 Subject: [PATCH 2/2] Rename Publish::PublishController to Publish::ApplicationController --- .../{publish_controller.rb => application_controller.rb} | 2 +- .../a_level_requirements/a_level_requirements_controller.rb | 2 +- app/controllers/publish/courses/about_this_course_controller.rb | 2 +- .../publish/courses/accredited_provider_controller.rb | 2 +- app/controllers/publish/courses/age_range_controller.rb | 2 +- .../publish/courses/application_status_controller.rb | 2 +- app/controllers/publish/courses/applications_open_controller.rb | 2 +- app/controllers/publish/courses/base_funding_type_controller.rb | 2 +- app/controllers/publish/courses/degrees/grade_controller.rb | 2 +- app/controllers/publish/courses/degrees/start_controller.rb | 2 +- .../publish/courses/degrees/subject_requirements_controller.rb | 2 +- app/controllers/publish/courses/deletions_controller.rb | 2 +- app/controllers/publish/courses/draft_rollover_controller.rb | 2 +- .../publish/courses/engineers_teach_physics_controller.rb | 2 +- .../publish/courses/fees_and_financial_support_controller.rb | 2 +- app/controllers/publish/courses/funding_type_controller.rb | 2 +- app/controllers/publish/courses/gcse_requirements_controller.rb | 2 +- app/controllers/publish/courses/interview_process_controller.rb | 2 +- app/controllers/publish/courses/length_controller.rb | 2 +- app/controllers/publish/courses/level_controller.rb | 2 +- app/controllers/publish/courses/modern_languages_controller.rb | 2 +- app/controllers/publish/courses/outcome_controller.rb | 2 +- app/controllers/publish/courses/providers_controller.rb | 2 +- app/controllers/publish/courses/school_placements_controller.rb | 2 +- app/controllers/publish/courses/schools_controller.rb | 2 +- app/controllers/publish/courses/start_date_controller.rb | 2 +- app/controllers/publish/courses/study_mode_controller.rb | 2 +- app/controllers/publish/courses/study_sites_controller.rb | 2 +- app/controllers/publish/courses/subjects_controller.rb | 2 +- .../publish/courses/training_with_disabilities_controller.rb | 2 +- app/controllers/publish/courses/visa_sponsorship_controller.rb | 2 +- app/controllers/publish/courses/withdrawals_controller.rb | 2 +- app/controllers/publish/courses_controller.rb | 2 +- app/controllers/publish/notifications_controller.rb | 2 +- .../publish/providers/accredited_provider_search_controller.rb | 2 +- .../publish/providers/accredited_providers/checks_controller.rb | 2 +- .../publish/providers/accredited_providers_controller.rb | 2 +- app/controllers/publish/providers/contacts_controller.rb | 2 +- .../publish/providers/school_placements_controller.rb | 2 +- app/controllers/publish/providers/school_search_controller.rb | 2 +- app/controllers/publish/providers/schools_check_controller.rb | 2 +- app/controllers/publish/providers/schools_controller.rb | 2 +- .../publish/providers/skilled_worker_visa_controller.rb | 2 +- app/controllers/publish/providers/student_visa_controller.rb | 2 +- .../publish/providers/study_site_search_controller.rb | 2 +- .../publish/providers/study_sites_check_controller.rb | 2 +- app/controllers/publish/providers/study_sites_controller.rb | 2 +- .../providers/training_providers/course_exports_controller.rb | 2 +- .../publish/providers/training_providers/courses_controller.rb | 2 +- .../publish/providers/training_providers_controller.rb | 2 +- app/controllers/publish/providers_controller.rb | 2 +- app/controllers/publish/recruitment_cycles_controller.rb | 2 +- app/controllers/publish/terms_controller.rb | 2 +- app/controllers/publish/users_check_controller.rb | 2 +- app/controllers/publish/users_controller.rb | 2 +- app/controllers/publish/users_edit_check_controller.rb | 2 +- 56 files changed, 56 insertions(+), 56 deletions(-) rename app/controllers/publish/{publish_controller.rb => application_controller.rb} (96%) diff --git a/app/controllers/publish/publish_controller.rb b/app/controllers/publish/application_controller.rb similarity index 96% rename from app/controllers/publish/publish_controller.rb rename to app/controllers/publish/application_controller.rb index 79b343df6f..5ac759dd41 100644 --- a/app/controllers/publish/publish_controller.rb +++ b/app/controllers/publish/application_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Publish - class PublishController < ApplicationController + class ApplicationController < ::ApplicationController include SuccessMessage layout 'publish' diff --git a/app/controllers/publish/courses/a_level_requirements/a_level_requirements_controller.rb b/app/controllers/publish/courses/a_level_requirements/a_level_requirements_controller.rb index 28388535eb..857a433ef8 100644 --- a/app/controllers/publish/courses/a_level_requirements/a_level_requirements_controller.rb +++ b/app/controllers/publish/courses/a_level_requirements/a_level_requirements_controller.rb @@ -3,7 +3,7 @@ module Publish module Courses module ALevelRequirements - class ALevelRequirementsController < PublishController + class ALevelRequirementsController < ApplicationController before_action :assign_course, :verify_teacher_degree_apprenticeship_course def new diff --git a/app/controllers/publish/courses/about_this_course_controller.rb b/app/controllers/publish/courses/about_this_course_controller.rb index 6aa08b82db..a26d51dcd5 100644 --- a/app/controllers/publish/courses/about_this_course_controller.rb +++ b/app/controllers/publish/courses/about_this_course_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class AboutThisCourseController < PublishController + class AboutThisCourseController < ApplicationController include GotoPreview include CopyCourseContent diff --git a/app/controllers/publish/courses/accredited_provider_controller.rb b/app/controllers/publish/courses/accredited_provider_controller.rb index 49fcb7ec7f..50a1a39c75 100644 --- a/app/controllers/publish/courses/accredited_provider_controller.rb +++ b/app/controllers/publish/courses/accredited_provider_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class AccreditedProviderController < PublishController + class AccreditedProviderController < ApplicationController include CourseBasicDetailConcern before_action :build_course, only: %i[edit update] before_action :build_course_params, only: :continue diff --git a/app/controllers/publish/courses/age_range_controller.rb b/app/controllers/publish/courses/age_range_controller.rb index 5f310b3d4e..19895fc504 100644 --- a/app/controllers/publish/courses/age_range_controller.rb +++ b/app/controllers/publish/courses/age_range_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class AgeRangeController < PublishController + class AgeRangeController < ApplicationController include CourseBasicDetailConcern decorates_assigned :course diff --git a/app/controllers/publish/courses/application_status_controller.rb b/app/controllers/publish/courses/application_status_controller.rb index a5bdeb667f..1dca96cdb3 100644 --- a/app/controllers/publish/courses/application_status_controller.rb +++ b/app/controllers/publish/courses/application_status_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class ApplicationStatusController < PublishController + class ApplicationStatusController < ApplicationController def new course end diff --git a/app/controllers/publish/courses/applications_open_controller.rb b/app/controllers/publish/courses/applications_open_controller.rb index 1701682b54..9bc5f377b7 100644 --- a/app/controllers/publish/courses/applications_open_controller.rb +++ b/app/controllers/publish/courses/applications_open_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class ApplicationsOpenController < PublishController + class ApplicationsOpenController < ApplicationController before_action :build_recruitment_cycle before_action :build_course_params, only: %i[update continue] include CourseBasicDetailConcern diff --git a/app/controllers/publish/courses/base_funding_type_controller.rb b/app/controllers/publish/courses/base_funding_type_controller.rb index ad06bc1290..04be93ad0c 100644 --- a/app/controllers/publish/courses/base_funding_type_controller.rb +++ b/app/controllers/publish/courses/base_funding_type_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class BaseFundingTypeController < PublishController + class BaseFundingTypeController < ApplicationController include SuccessMessage include GotoPreview diff --git a/app/controllers/publish/courses/degrees/grade_controller.rb b/app/controllers/publish/courses/degrees/grade_controller.rb index 303b923532..52dd787a23 100644 --- a/app/controllers/publish/courses/degrees/grade_controller.rb +++ b/app/controllers/publish/courses/degrees/grade_controller.rb @@ -3,7 +3,7 @@ module Publish module Courses module Degrees - class GradeController < PublishController + class GradeController < ApplicationController include GotoPreview def edit diff --git a/app/controllers/publish/courses/degrees/start_controller.rb b/app/controllers/publish/courses/degrees/start_controller.rb index 134fc7882d..16dd869ad3 100644 --- a/app/controllers/publish/courses/degrees/start_controller.rb +++ b/app/controllers/publish/courses/degrees/start_controller.rb @@ -3,7 +3,7 @@ module Publish module Courses module Degrees - class StartController < PublishController + class StartController < ApplicationController include GotoPreview def edit diff --git a/app/controllers/publish/courses/degrees/subject_requirements_controller.rb b/app/controllers/publish/courses/degrees/subject_requirements_controller.rb index cfdd122671..7f598e90c7 100644 --- a/app/controllers/publish/courses/degrees/subject_requirements_controller.rb +++ b/app/controllers/publish/courses/degrees/subject_requirements_controller.rb @@ -3,7 +3,7 @@ module Publish module Courses module Degrees - class SubjectRequirementsController < PublishController + class SubjectRequirementsController < ApplicationController include CopyCourseContent include GotoPreview diff --git a/app/controllers/publish/courses/deletions_controller.rb b/app/controllers/publish/courses/deletions_controller.rb index 2ed0abdb77..3b0e27762d 100644 --- a/app/controllers/publish/courses/deletions_controller.rb +++ b/app/controllers/publish/courses/deletions_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class DeletionsController < PublishController + class DeletionsController < ApplicationController before_action :redirect_to_courses, if: -> { course&.is_published? } def edit diff --git a/app/controllers/publish/courses/draft_rollover_controller.rb b/app/controllers/publish/courses/draft_rollover_controller.rb index 08e64cd80a..40e25ea8d2 100644 --- a/app/controllers/publish/courses/draft_rollover_controller.rb +++ b/app/controllers/publish/courses/draft_rollover_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class DraftRolloverController < PublishController + class DraftRolloverController < ApplicationController before_action :redirect_to_courses, if: -> { course.is_published? } def edit diff --git a/app/controllers/publish/courses/engineers_teach_physics_controller.rb b/app/controllers/publish/courses/engineers_teach_physics_controller.rb index cfe5b4b34a..d0256205f8 100644 --- a/app/controllers/publish/courses/engineers_teach_physics_controller.rb +++ b/app/controllers/publish/courses/engineers_teach_physics_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class EngineersTeachPhysicsController < PublishController + class EngineersTeachPhysicsController < ApplicationController decorates_assigned :course include CourseBasicDetailConcern diff --git a/app/controllers/publish/courses/fees_and_financial_support_controller.rb b/app/controllers/publish/courses/fees_and_financial_support_controller.rb index 910efcb8c8..3c475a92d5 100644 --- a/app/controllers/publish/courses/fees_and_financial_support_controller.rb +++ b/app/controllers/publish/courses/fees_and_financial_support_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class FeesAndFinancialSupportController < PublishController + class FeesAndFinancialSupportController < ApplicationController include CopyCourseContent before_action :authorise_with_pundit diff --git a/app/controllers/publish/courses/funding_type_controller.rb b/app/controllers/publish/courses/funding_type_controller.rb index 7acde5a2a8..9eed4d21b6 100644 --- a/app/controllers/publish/courses/funding_type_controller.rb +++ b/app/controllers/publish/courses/funding_type_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class FundingTypeController < PublishController + class FundingTypeController < ApplicationController include CourseBasicDetailConcern def continue diff --git a/app/controllers/publish/courses/gcse_requirements_controller.rb b/app/controllers/publish/courses/gcse_requirements_controller.rb index 7559498895..2d317adfa2 100644 --- a/app/controllers/publish/courses/gcse_requirements_controller.rb +++ b/app/controllers/publish/courses/gcse_requirements_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class GcseRequirementsController < PublishController + class GcseRequirementsController < ApplicationController include CopyCourseContent include GotoPreview diff --git a/app/controllers/publish/courses/interview_process_controller.rb b/app/controllers/publish/courses/interview_process_controller.rb index 8a1030b0b7..23c04d1254 100644 --- a/app/controllers/publish/courses/interview_process_controller.rb +++ b/app/controllers/publish/courses/interview_process_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class InterviewProcessController < PublishController + class InterviewProcessController < ApplicationController include CopyCourseContent before_action :authorise_with_pundit diff --git a/app/controllers/publish/courses/length_controller.rb b/app/controllers/publish/courses/length_controller.rb index efa1610cb5..a2d95756e1 100644 --- a/app/controllers/publish/courses/length_controller.rb +++ b/app/controllers/publish/courses/length_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class LengthController < PublishController + class LengthController < ApplicationController before_action :redirect_if_not_editable def edit diff --git a/app/controllers/publish/courses/level_controller.rb b/app/controllers/publish/courses/level_controller.rb index b76bf7b402..569a5a35e8 100644 --- a/app/controllers/publish/courses/level_controller.rb +++ b/app/controllers/publish/courses/level_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class LevelController < PublishController + class LevelController < ApplicationController include CourseBasicDetailConcern private diff --git a/app/controllers/publish/courses/modern_languages_controller.rb b/app/controllers/publish/courses/modern_languages_controller.rb index 79e52949db..4ecc6da389 100644 --- a/app/controllers/publish/courses/modern_languages_controller.rb +++ b/app/controllers/publish/courses/modern_languages_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class ModernLanguagesController < PublishController + class ModernLanguagesController < ApplicationController decorates_assigned :course before_action :build_course, only: %i[edit update] before_action :build_course_params, only: [:continue] diff --git a/app/controllers/publish/courses/outcome_controller.rb b/app/controllers/publish/courses/outcome_controller.rb index 5f2e860c2a..752609ac8a 100644 --- a/app/controllers/publish/courses/outcome_controller.rb +++ b/app/controllers/publish/courses/outcome_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class OutcomeController < PublishController + class OutcomeController < ApplicationController include CourseBasicDetailConcern def continue diff --git a/app/controllers/publish/courses/providers_controller.rb b/app/controllers/publish/courses/providers_controller.rb index 8a13840a4c..44c016742c 100644 --- a/app/controllers/publish/courses/providers_controller.rb +++ b/app/controllers/publish/courses/providers_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class ProvidersController < PublishController + class ProvidersController < ApplicationController include CourseBasicDetailConcern before_action :build_course, only: %i[show] diff --git a/app/controllers/publish/courses/school_placements_controller.rb b/app/controllers/publish/courses/school_placements_controller.rb index 69aa889eca..4b9c727192 100644 --- a/app/controllers/publish/courses/school_placements_controller.rb +++ b/app/controllers/publish/courses/school_placements_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class SchoolPlacementsController < PublishController + class SchoolPlacementsController < ApplicationController include CopyCourseContent include GotoPreview diff --git a/app/controllers/publish/courses/schools_controller.rb b/app/controllers/publish/courses/schools_controller.rb index 8ae3717424..368dcd0ffe 100644 --- a/app/controllers/publish/courses/schools_controller.rb +++ b/app/controllers/publish/courses/schools_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class SchoolsController < PublishController + class SchoolsController < ApplicationController include CourseBasicDetailConcern def continue diff --git a/app/controllers/publish/courses/start_date_controller.rb b/app/controllers/publish/courses/start_date_controller.rb index c97ef6c827..1179182a25 100644 --- a/app/controllers/publish/courses/start_date_controller.rb +++ b/app/controllers/publish/courses/start_date_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class StartDateController < PublishController + class StartDateController < ApplicationController include CourseBasicDetailConcern private diff --git a/app/controllers/publish/courses/study_mode_controller.rb b/app/controllers/publish/courses/study_mode_controller.rb index 0c8cd6fea9..f50a69f209 100644 --- a/app/controllers/publish/courses/study_mode_controller.rb +++ b/app/controllers/publish/courses/study_mode_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class StudyModeController < PublishController + class StudyModeController < ApplicationController include CourseBasicDetailConcern def continue diff --git a/app/controllers/publish/courses/study_sites_controller.rb b/app/controllers/publish/courses/study_sites_controller.rb index b0cfdbf715..6b12cce141 100644 --- a/app/controllers/publish/courses/study_sites_controller.rb +++ b/app/controllers/publish/courses/study_sites_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class StudySitesController < PublishController + class StudySitesController < ApplicationController include CourseBasicDetailConcern def continue diff --git a/app/controllers/publish/courses/subjects_controller.rb b/app/controllers/publish/courses/subjects_controller.rb index bce62d84bc..5fe9cff51b 100644 --- a/app/controllers/publish/courses/subjects_controller.rb +++ b/app/controllers/publish/courses/subjects_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class SubjectsController < PublishController + class SubjectsController < ApplicationController decorates_assigned :course before_action :build_course, only: %i[edit update] before_action :build_course_params, :campaign_name_check, only: [:continue] diff --git a/app/controllers/publish/courses/training_with_disabilities_controller.rb b/app/controllers/publish/courses/training_with_disabilities_controller.rb index d754f78f6f..b84237d67b 100644 --- a/app/controllers/publish/courses/training_with_disabilities_controller.rb +++ b/app/controllers/publish/courses/training_with_disabilities_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class TrainingWithDisabilitiesController < PublishController + class TrainingWithDisabilitiesController < ApplicationController include CourseBasicDetailConcern before_action :build_course, only: %i[show] diff --git a/app/controllers/publish/courses/visa_sponsorship_controller.rb b/app/controllers/publish/courses/visa_sponsorship_controller.rb index 86011057d8..0d4917a898 100644 --- a/app/controllers/publish/courses/visa_sponsorship_controller.rb +++ b/app/controllers/publish/courses/visa_sponsorship_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class VisaSponsorshipController < PublishController + class VisaSponsorshipController < ApplicationController include CourseBasicDetailConcern def new diff --git a/app/controllers/publish/courses/withdrawals_controller.rb b/app/controllers/publish/courses/withdrawals_controller.rb index e8a8f13a86..1c6e14aa28 100644 --- a/app/controllers/publish/courses/withdrawals_controller.rb +++ b/app/controllers/publish/courses/withdrawals_controller.rb @@ -2,7 +2,7 @@ module Publish module Courses - class WithdrawalsController < PublishController + class WithdrawalsController < ApplicationController before_action :redirect_to_courses, if: :course_withdrawn? before_action :redirect_to_courses, unless: -> { course.is_published? } diff --git a/app/controllers/publish/courses_controller.rb b/app/controllers/publish/courses_controller.rb index 6f23eb1565..2aedfe2625 100644 --- a/app/controllers/publish/courses_controller.rb +++ b/app/controllers/publish/courses_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Publish - class CoursesController < PublishController + class CoursesController < ApplicationController include ApplyRedirect decorates_assigned :course diff --git a/app/controllers/publish/notifications_controller.rb b/app/controllers/publish/notifications_controller.rb index 6fa5145dc0..3efcc44715 100644 --- a/app/controllers/publish/notifications_controller.rb +++ b/app/controllers/publish/notifications_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Publish - class NotificationsController < PublishController + class NotificationsController < ApplicationController skip_before_action :check_interrupt_redirects skip_before_action :authorize_provider diff --git a/app/controllers/publish/providers/accredited_provider_search_controller.rb b/app/controllers/publish/providers/accredited_provider_search_controller.rb index fa5cae2f93..fb23870f1d 100644 --- a/app/controllers/publish/providers/accredited_provider_search_controller.rb +++ b/app/controllers/publish/providers/accredited_provider_search_controller.rb @@ -2,7 +2,7 @@ module Publish module Providers - class AccreditedProviderSearchController < PublishController + class AccreditedProviderSearchController < ApplicationController helper_method :query, :search_result_title_component def new diff --git a/app/controllers/publish/providers/accredited_providers/checks_controller.rb b/app/controllers/publish/providers/accredited_providers/checks_controller.rb index 287a092d56..7d71842637 100644 --- a/app/controllers/publish/providers/accredited_providers/checks_controller.rb +++ b/app/controllers/publish/providers/accredited_providers/checks_controller.rb @@ -3,7 +3,7 @@ module Publish module Providers module AccreditedProviders - class ChecksController < PublishController + class ChecksController < ApplicationController def show accredited_provider_form end diff --git a/app/controllers/publish/providers/accredited_providers_controller.rb b/app/controllers/publish/providers/accredited_providers_controller.rb index 2e4d1d97c9..7c4e8b0dfa 100644 --- a/app/controllers/publish/providers/accredited_providers_controller.rb +++ b/app/controllers/publish/providers/accredited_providers_controller.rb @@ -2,7 +2,7 @@ module Publish module Providers - class AccreditedProvidersController < PublishController + class AccreditedProvidersController < ApplicationController helper_method :accredited_provider_id def index; end diff --git a/app/controllers/publish/providers/contacts_controller.rb b/app/controllers/publish/providers/contacts_controller.rb index 4088e6e755..a44844e5db 100644 --- a/app/controllers/publish/providers/contacts_controller.rb +++ b/app/controllers/publish/providers/contacts_controller.rb @@ -2,7 +2,7 @@ module Publish module Providers - class ContactsController < PublishController + class ContactsController < ApplicationController def edit authorize(provider, :edit?) diff --git a/app/controllers/publish/providers/school_placements_controller.rb b/app/controllers/publish/providers/school_placements_controller.rb index a314abcfd7..a1e46eff6c 100644 --- a/app/controllers/publish/providers/school_placements_controller.rb +++ b/app/controllers/publish/providers/school_placements_controller.rb @@ -2,7 +2,7 @@ module Publish module Providers - class SchoolPlacementsController < PublishController + class SchoolPlacementsController < ApplicationController def edit authorize(provider, :edit?) diff --git a/app/controllers/publish/providers/school_search_controller.rb b/app/controllers/publish/providers/school_search_controller.rb index 7a03a66d4b..f93b8e3389 100644 --- a/app/controllers/publish/providers/school_search_controller.rb +++ b/app/controllers/publish/providers/school_search_controller.rb @@ -2,7 +2,7 @@ module Publish module Providers - class SchoolSearchController < PublishController + class SchoolSearchController < ApplicationController helper_method :query, :search_result_title_component before_action :authorize_provider diff --git a/app/controllers/publish/providers/schools_check_controller.rb b/app/controllers/publish/providers/schools_check_controller.rb index 469c5161e9..81d66a20ae 100644 --- a/app/controllers/publish/providers/schools_check_controller.rb +++ b/app/controllers/publish/providers/schools_check_controller.rb @@ -2,7 +2,7 @@ module Publish module Providers - class SchoolsCheckController < PublishController + class SchoolsCheckController < ApplicationController before_action :new_form def show; end diff --git a/app/controllers/publish/providers/schools_controller.rb b/app/controllers/publish/providers/schools_controller.rb index a12b697558..8e2b064844 100644 --- a/app/controllers/publish/providers/schools_controller.rb +++ b/app/controllers/publish/providers/schools_controller.rb @@ -2,7 +2,7 @@ module Publish module Providers - class SchoolsController < PublishController + class SchoolsController < ApplicationController before_action :site, only: %i[show delete] def index diff --git a/app/controllers/publish/providers/skilled_worker_visa_controller.rb b/app/controllers/publish/providers/skilled_worker_visa_controller.rb index 9b36740f3d..7b513d4a6f 100644 --- a/app/controllers/publish/providers/skilled_worker_visa_controller.rb +++ b/app/controllers/publish/providers/skilled_worker_visa_controller.rb @@ -2,7 +2,7 @@ module Publish module Providers - class SkilledWorkerVisaController < PublishController + class SkilledWorkerVisaController < ApplicationController def edit authorize(provider, :edit?) diff --git a/app/controllers/publish/providers/student_visa_controller.rb b/app/controllers/publish/providers/student_visa_controller.rb index 9dd794b904..26c5308a70 100644 --- a/app/controllers/publish/providers/student_visa_controller.rb +++ b/app/controllers/publish/providers/student_visa_controller.rb @@ -2,7 +2,7 @@ module Publish module Providers - class StudentVisaController < PublishController + class StudentVisaController < ApplicationController def edit authorize(provider, :edit?) diff --git a/app/controllers/publish/providers/study_site_search_controller.rb b/app/controllers/publish/providers/study_site_search_controller.rb index 958c62689a..807271c7b1 100644 --- a/app/controllers/publish/providers/study_site_search_controller.rb +++ b/app/controllers/publish/providers/study_site_search_controller.rb @@ -2,7 +2,7 @@ module Publish module Providers - class StudySiteSearchController < PublishController + class StudySiteSearchController < ApplicationController helper_method :query, :search_result_title_component before_action :authorize_provider diff --git a/app/controllers/publish/providers/study_sites_check_controller.rb b/app/controllers/publish/providers/study_sites_check_controller.rb index a910110f6f..f089194588 100644 --- a/app/controllers/publish/providers/study_sites_check_controller.rb +++ b/app/controllers/publish/providers/study_sites_check_controller.rb @@ -2,7 +2,7 @@ module Publish module Providers - class StudySitesCheckController < PublishController + class StudySitesCheckController < ApplicationController before_action :new_form def show; end diff --git a/app/controllers/publish/providers/study_sites_controller.rb b/app/controllers/publish/providers/study_sites_controller.rb index 5dba466c31..8f77d8f49e 100644 --- a/app/controllers/publish/providers/study_sites_controller.rb +++ b/app/controllers/publish/providers/study_sites_controller.rb @@ -2,7 +2,7 @@ module Publish module Providers - class StudySitesController < PublishController + class StudySitesController < ApplicationController before_action :site, only: %i[show delete] before_action :build_study_site, only: %i[new create] diff --git a/app/controllers/publish/providers/training_providers/course_exports_controller.rb b/app/controllers/publish/providers/training_providers/course_exports_controller.rb index c8219585f4..23f280a14e 100644 --- a/app/controllers/publish/providers/training_providers/course_exports_controller.rb +++ b/app/controllers/publish/providers/training_providers/course_exports_controller.rb @@ -3,7 +3,7 @@ module Publish module Providers module TrainingProviders - class CourseExportsController < PublishController + class CourseExportsController < ApplicationController def index authorize(provider, :can_list_training_providers?) diff --git a/app/controllers/publish/providers/training_providers/courses_controller.rb b/app/controllers/publish/providers/training_providers/courses_controller.rb index 726a964fce..a2091d3a6c 100644 --- a/app/controllers/publish/providers/training_providers/courses_controller.rb +++ b/app/controllers/publish/providers/training_providers/courses_controller.rb @@ -3,7 +3,7 @@ module Publish module Providers module TrainingProviders - class CoursesController < PublishController + class CoursesController < ApplicationController def index authorize(provider, :index?) diff --git a/app/controllers/publish/providers/training_providers_controller.rb b/app/controllers/publish/providers/training_providers_controller.rb index b2712c981a..5bd16f2feb 100644 --- a/app/controllers/publish/providers/training_providers_controller.rb +++ b/app/controllers/publish/providers/training_providers_controller.rb @@ -2,7 +2,7 @@ module Publish module Providers - class TrainingProvidersController < PublishController + class TrainingProvidersController < ApplicationController def index authorize(provider, :can_list_training_providers?) diff --git a/app/controllers/publish/providers_controller.rb b/app/controllers/publish/providers_controller.rb index 81a79d977b..e9ddf5bd91 100644 --- a/app/controllers/publish/providers_controller.rb +++ b/app/controllers/publish/providers_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Publish - class ProvidersController < PublishController + class ProvidersController < ApplicationController include RecruitmentCycleHelper include GotoPreview rescue_from ActiveRecord::RecordNotFound, with: :render_not_found diff --git a/app/controllers/publish/recruitment_cycles_controller.rb b/app/controllers/publish/recruitment_cycles_controller.rb index ab5956a9f2..1f7b2a9ed4 100644 --- a/app/controllers/publish/recruitment_cycles_controller.rb +++ b/app/controllers/publish/recruitment_cycles_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Publish - class RecruitmentCyclesController < PublishController + class RecruitmentCyclesController < ApplicationController def show @recruitment_cycle = RecruitmentCycle.find_by(year: params[:year]) @provider ||= recruitment_cycle.providers.find_by!(provider_code: params[:provider_code] || params[:code]) diff --git a/app/controllers/publish/terms_controller.rb b/app/controllers/publish/terms_controller.rb index 7ee0aafede..c1ac952299 100644 --- a/app/controllers/publish/terms_controller.rb +++ b/app/controllers/publish/terms_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Publish - class TermsController < ApplicationController + class TermsController < ::ApplicationController def edit @accept_terms_form = Interruption::AcceptTermsForm.new(current_user) end diff --git a/app/controllers/publish/users_check_controller.rb b/app/controllers/publish/users_check_controller.rb index 4e56ae4a3b..6b8b46c257 100644 --- a/app/controllers/publish/users_check_controller.rb +++ b/app/controllers/publish/users_check_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Publish - class UsersCheckController < PublishController + class UsersCheckController < ApplicationController def show @user_form = UserForm.new(current_user, user) end diff --git a/app/controllers/publish/users_controller.rb b/app/controllers/publish/users_controller.rb index 0578cf4177..2e01aac863 100644 --- a/app/controllers/publish/users_controller.rb +++ b/app/controllers/publish/users_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Publish - class UsersController < PublishController + class UsersController < ApplicationController def index @pagy, @users = pagy(provider.users.in_name_order) end diff --git a/app/controllers/publish/users_edit_check_controller.rb b/app/controllers/publish/users_edit_check_controller.rb index 47258040c8..dbae797441 100644 --- a/app/controllers/publish/users_edit_check_controller.rb +++ b/app/controllers/publish/users_edit_check_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Publish - class UsersEditCheckController < PublishController + class UsersEditCheckController < ApplicationController def show @user_form = UserForm.new(current_user, user) end