diff --git a/app/controllers/tasks_controller.rb b/app/controllers/tasks_controller.rb index 9d0744105..bf56f0a1d 100644 --- a/app/controllers/tasks_controller.rb +++ b/app/controllers/tasks_controller.rb @@ -105,7 +105,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), @@ -207,9 +207,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 bcbeffd74..d6279ad63 100644 --- a/config/application.rb +++ b/config/application.rb @@ -30,7 +30,7 @@ class Application < Rails::Application config.time_zone = ENV.fetch('RAILS_TIME_ZONE', 'UTC') # 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]