From d62d18c9ff522cb6cb73fdf16ac8208031408456 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Mar 2022 03:02:04 +0000 Subject: [PATCH 1/3] Bump rubocop-rails from 2.13.2 to 2.14.2 Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.13.2 to 2.14.2. - [Release notes](https://github.com/rubocop/rubocop-rails/releases) - [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.13.2...v2.14.2) --- updated-dependencies: - dependency-name: rubocop-rails dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 34052dbd..8fb2213e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -423,7 +423,7 @@ GEM rubocop-performance (1.13.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - rubocop-rails (2.13.2) + rubocop-rails (2.14.2) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.7.0, < 2.0) From ccdba79cbf06213d9c32e1ec06ef3e6d7773f43b Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Mon, 21 Mar 2022 09:04:01 +0100 Subject: [PATCH 2/3] Extract locales in accordance with Rails/I18nLocaleTexts --- app/controllers/error_template_attributes_controller.rb | 6 +++--- app/controllers/error_templates_controller.rb | 6 +++--- app/controllers/file_templates_controller.rb | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/controllers/error_template_attributes_controller.rb b/app/controllers/error_template_attributes_controller.rb index 8540ce1d..3ad29480 100644 --- a/app/controllers/error_template_attributes_controller.rb +++ b/app/controllers/error_template_attributes_controller.rb @@ -42,7 +42,7 @@ class ErrorTemplateAttributesController < ApplicationController respond_to do |format| if @error_template_attribute.save format.html do - redirect_to @error_template_attribute, notice: 'Error template attribute was successfully created.' + redirect_to @error_template_attribute, notice: t('shared.object_created', model: @error_template_attribute.class.model_name.human) end format.json { render :show, status: :created, location: @error_template_attribute } else @@ -59,7 +59,7 @@ class ErrorTemplateAttributesController < ApplicationController respond_to do |format| if @error_template_attribute.update(error_template_attribute_params) format.html do - redirect_to @error_template_attribute, notice: 'Error template attribute was successfully updated.' + redirect_to @error_template_attribute, notice: t('shared.object_updated', model: @error_template_attribute.class.model_name.human) end format.json { render :show, status: :ok, location: @error_template_attribute } else @@ -76,7 +76,7 @@ class ErrorTemplateAttributesController < ApplicationController @error_template_attribute.destroy respond_to do |format| format.html do - redirect_to error_template_attributes_url, notice: 'Error template attribute was successfully destroyed.' + redirect_to error_template_attributes_url, notice: t('shared.object_destroyed', model: @error_template_attribute.class.model_name.human) end format.json { head :no_content } end diff --git a/app/controllers/error_templates_controller.rb b/app/controllers/error_templates_controller.rb index b66d48d5..e459cef4 100644 --- a/app/controllers/error_templates_controller.rb +++ b/app/controllers/error_templates_controller.rb @@ -40,7 +40,7 @@ class ErrorTemplatesController < ApplicationController respond_to do |format| if @error_template.save - format.html { redirect_to @error_template, notice: 'Error template was successfully created.' } + format.html { redirect_to @error_template, notice: t('shared.object_created', model: @error_template.class.model_name.human) } format.json { render :show, status: :created, location: @error_template } else format.html { render :new } @@ -55,7 +55,7 @@ class ErrorTemplatesController < ApplicationController authorize! respond_to do |format| if @error_template.update(error_template_params) - format.html { redirect_to @error_template, notice: 'Error template was successfully updated.' } + format.html { redirect_to @error_template, notice: t('shared.object_updated', model: @error_template.class.model_name.human) } format.json { render :show, status: :ok, location: @error_template } else format.html { render :edit } @@ -70,7 +70,7 @@ class ErrorTemplatesController < ApplicationController authorize! @error_template.destroy respond_to do |format| - format.html { redirect_to error_templates_url, notice: 'Error template was successfully destroyed.' } + format.html { redirect_to error_templates_url, notice: t('shared.object_destroyed', model: @error_template.class.model_name.human) } format.json { head :no_content } end end diff --git a/app/controllers/file_templates_controller.rb b/app/controllers/file_templates_controller.rb index 9852a68a..e8813e1c 100644 --- a/app/controllers/file_templates_controller.rb +++ b/app/controllers/file_templates_controller.rb @@ -48,7 +48,7 @@ class FileTemplatesController < ApplicationController respond_to do |format| if @file_template.save - format.html { redirect_to @file_template, notice: 'File template was successfully created.' } + format.html { redirect_to @file_template, notice: t('shared.object_created', model: @file_template.class.model_name.human) } format.json { render :show, status: :created, location: @file_template } else format.html { render :new } @@ -63,7 +63,7 @@ class FileTemplatesController < ApplicationController authorize! respond_to do |format| if @file_template.update(file_template_params) - format.html { redirect_to @file_template, notice: 'File template was successfully updated.' } + format.html { redirect_to @file_template, notice: t('shared.object_updated', model: @file_template.class.model_name.human) } format.json { render :show, status: :ok, location: @file_template } else format.html { render :edit } @@ -78,7 +78,7 @@ class FileTemplatesController < ApplicationController authorize! @file_template.destroy respond_to do |format| - format.html { redirect_to file_templates_url, notice: 'File template was successfully destroyed.' } + format.html { redirect_to file_templates_url, notice: t('shared.object_destroyed', model: @file_template.class.model_name.human) } format.json { head :no_content } end end From 8b583ea2c96a958dab52bbf213fed413370d3935 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Mon, 21 Mar 2022 09:04:20 +0100 Subject: [PATCH 3/3] Fix Rails/DeprecatedActiveModelErrorsMethods --- app/validators/code_ocean/file_name_validator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/validators/code_ocean/file_name_validator.rb b/app/validators/code_ocean/file_name_validator.rb index f9161458..0c377f01 100644 --- a/app/validators/code_ocean/file_name_validator.rb +++ b/app/validators/code_ocean/file_name_validator.rb @@ -6,7 +6,7 @@ module CodeOcean existing_files = File.where(name: record.name, path: record.path, file_type_id: record.file_type_id, context_id: record.context_id, context_type: record.context_type).to_a if !existing_files.empty? && (!record.context.is_a?(Exercise) || record.context.new_record?) - record.errors[:base] << 'Duplicate' + record.errors.add(:base, 'Duplicate') end end end