From bde3960afd1afdba9cb81f09a72dbb3d65ee2cdc Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Mon, 26 Aug 2024 11:22:35 +0200 Subject: [PATCH] Fix Rubocop offenses --- app/controllers/tasks_controller.rb | 6 +++--- config/application.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/tasks_controller.rb b/app/controllers/tasks_controller.rb index 8126bfd9d..548e14da5 100644 --- a/app/controllers/tasks_controller.rb +++ b/app/controllers/tasks_controller.rb @@ -107,7 +107,7 @@ def import_start # rubocop:disable Metrics/AbcSize, Metrics/MethodLength end rescue ProformaXML::ProformaError => e messages = prettify_import_errors(e) - flash[:alert] = messages + flash.now[:alert] = messages render json: { status: 'failure', message: t('.error', error: messages), @@ -209,9 +209,9 @@ def export_external_confirm def generate_test GptService::GenerateTests.call(task: @task, openai_api_key: current_user.openai_api_key) - flash[:notice] = I18n.t('tasks.task_service.gpt_generate_tests.successful_generation') + flash.now[:notice] = I18n.t('tasks.task_service.gpt_generate_tests.successful_generation') rescue Gpt::Error => e - flash[:alert] = e.localized_message + flash.now[:alert] = e.localized_message ensure redirect_to @task end diff --git a/config/application.rb b/config/application.rb index 8ff5965f6..c3ef48a7f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -31,7 +31,7 @@ class Application < Rails::Application # config.eager_load_paths << Rails.root.join("extras") # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. - config.i18n.load_path += Dir[Rails.root.join('config/locales/**/*.{rb,yml}')] + config.i18n.load_path += Rails.root.glob('config/locales/**/*.{rb,yml}') # config.i18n.default_locale = :de config.i18n.available_locales = %i[de en]