From 9b822e4682fe90e4083774273c3b4fd7a08930e3 Mon Sep 17 00:00:00 2001 From: Benjamin Schaaf Date: Mon, 27 May 2024 16:43:14 +0200 Subject: [PATCH] Upgrade to rails 6.1 --- Gemfile | 2 +- Gemfile.lock | 131 +++++++++++----------- config/application.rb | 2 +- lib/validators/reduce_errors_validator.rb | 3 +- 4 files changed, 70 insertions(+), 68 deletions(-) diff --git a/Gemfile b/Gemfile index 0d0536797..92ef25e6f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'rails', '~> 6.0.0' +gem 'rails', '~> 6.1.0' gem 'rake', '~> 12.0' # Use postgres gem 'pg', '~> 1.0' diff --git a/Gemfile.lock b/Gemfile.lock index 40da6d4e5..f98a2b3ee 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,38 +1,40 @@ GEM remote: https://rubygems.org/ specs: - actioncable (6.0.6.1) - actionpack (= 6.0.6.1) + actioncable (6.1.7.7) + actionpack (= 6.1.7.7) + activesupport (= 6.1.7.7) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.0.6.1) - actionpack (= 6.0.6.1) - activejob (= 6.0.6.1) - activerecord (= 6.0.6.1) - activestorage (= 6.0.6.1) - activesupport (= 6.0.6.1) + actionmailbox (6.1.7.7) + actionpack (= 6.1.7.7) + activejob (= 6.1.7.7) + activerecord (= 6.1.7.7) + activestorage (= 6.1.7.7) + activesupport (= 6.1.7.7) mail (>= 2.7.1) - actionmailer (6.0.6.1) - actionpack (= 6.0.6.1) - actionview (= 6.0.6.1) - activejob (= 6.0.6.1) + actionmailer (6.1.7.7) + actionpack (= 6.1.7.7) + actionview (= 6.1.7.7) + activejob (= 6.1.7.7) + activesupport (= 6.1.7.7) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.0.6.1) - actionview (= 6.0.6.1) - activesupport (= 6.0.6.1) - rack (~> 2.0, >= 2.0.8) + actionpack (6.1.7.7) + actionview (= 6.1.7.7) + activesupport (= 6.1.7.7) + rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.0.6.1) - actionpack (= 6.0.6.1) - activerecord (= 6.0.6.1) - activestorage (= 6.0.6.1) - activesupport (= 6.0.6.1) + actiontext (6.1.7.7) + actionpack (= 6.1.7.7) + activerecord (= 6.1.7.7) + activestorage (= 6.1.7.7) + activesupport (= 6.1.7.7) nokogiri (>= 1.8.5) - actionview (6.0.6.1) - activesupport (= 6.0.6.1) + actionview (6.1.7.7) + activesupport (= 6.1.7.7) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -46,25 +48,27 @@ GEM activerecord (>= 4.2.0) active_record_union (1.3.0) activerecord (>= 4.0) - activejob (6.0.6.1) - activesupport (= 6.0.6.1) + activejob (6.1.7.7) + activesupport (= 6.1.7.7) globalid (>= 0.3.6) - activemodel (6.0.6.1) - activesupport (= 6.0.6.1) - activerecord (6.0.6.1) - activemodel (= 6.0.6.1) - activesupport (= 6.0.6.1) - activestorage (6.0.6.1) - actionpack (= 6.0.6.1) - activejob (= 6.0.6.1) - activerecord (= 6.0.6.1) + activemodel (6.1.7.7) + activesupport (= 6.1.7.7) + activerecord (6.1.7.7) + activemodel (= 6.1.7.7) + activesupport (= 6.1.7.7) + activestorage (6.1.7.7) + actionpack (= 6.1.7.7) + activejob (= 6.1.7.7) + activerecord (= 6.1.7.7) + activesupport (= 6.1.7.7) marcel (~> 1.0) - activesupport (6.0.6.1) + mini_mime (>= 1.1.0) + activesupport (6.1.7.7) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.2, >= 2.2.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) airbrussh (1.5.2) @@ -164,8 +168,8 @@ GEM ffi (1.16.3) font-awesome-rails (4.7.0.8) railties (>= 3.2, < 8.0) - globalid (1.1.0) - activesupport (>= 5.0) + globalid (1.2.1) + activesupport (>= 6.1) graph_matching (0.1.1) rgl (~> 0.5.0) haml (6.1.4) @@ -274,20 +278,20 @@ GEM ruby-openid (>= 2.1.8) rack-test (2.1.0) rack (>= 1.3) - rails (6.0.6.1) - actioncable (= 6.0.6.1) - actionmailbox (= 6.0.6.1) - actionmailer (= 6.0.6.1) - actionpack (= 6.0.6.1) - actiontext (= 6.0.6.1) - actionview (= 6.0.6.1) - activejob (= 6.0.6.1) - activemodel (= 6.0.6.1) - activerecord (= 6.0.6.1) - activestorage (= 6.0.6.1) - activesupport (= 6.0.6.1) - bundler (>= 1.3.0) - railties (= 6.0.6.1) + rails (6.1.7.7) + actioncable (= 6.1.7.7) + actionmailbox (= 6.1.7.7) + actionmailer (= 6.1.7.7) + actionpack (= 6.1.7.7) + actiontext (= 6.1.7.7) + actionview (= 6.1.7.7) + activejob (= 6.1.7.7) + activemodel (= 6.1.7.7) + activerecord (= 6.1.7.7) + activestorage (= 6.1.7.7) + activesupport (= 6.1.7.7) + bundler (>= 1.15.0) + railties (= 6.1.7.7) sprockets-rails (>= 2.0.0) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) @@ -303,12 +307,12 @@ GEM json require_all (~> 3.0) ruby-progressbar - railties (6.0.6.1) - actionpack (= 6.0.6.1) - activesupport (= 6.0.6.1) + railties (6.1.7.7) + actionpack (= 6.1.7.7) + activesupport (= 6.1.7.7) method_source - rake (>= 0.8.7) - thor (>= 0.20.3, < 2.0) + rake (>= 12.2) + thor (~> 1.0) rainbow (3.1.1) rake (12.3.3) redcarpet (3.6.0) @@ -403,13 +407,12 @@ GEM sysexits (1.2.0) temple (0.10.3) thor (1.2.2) - thread_safe (0.3.6) tilt (2.3.0) timeout (0.4.0) tournament-system (2.1.0) graph_matching (~> 0.1.1) - tzinfo (1.2.11) - thread_safe (~> 0.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) uglifier (4.2.0) execjs (>= 0.3.0, < 3) unicode-display_width (1.8.0) @@ -464,7 +467,7 @@ DEPENDENCIES pagedown-bootstrap-rails parallel_tests pg (~> 1.0) - rails (~> 6.0.0) + rails (~> 6.1.0) rails_best_practices rake (~> 12.0) redcarpet diff --git a/config/application.rb b/config/application.rb index d60416005..30a9ad9b3 100644 --- a/config/application.rb +++ b/config/application.rb @@ -30,7 +30,7 @@ class Application < Rails::Application config.exceptions_app = self.routes # News config file - config.news = config_for(:news) + config.news = config_for(:news).with_indifferent_access # config.middleware.use 'BadMultipartFormDataSanitizer' config.middleware.insert_before Rack::Runtime, BadMultipartFormDataSanitizer diff --git a/lib/validators/reduce_errors_validator.rb b/lib/validators/reduce_errors_validator.rb index ba7abaf3d..8103c841c 100644 --- a/lib/validators/reduce_errors_validator.rb +++ b/lib/validators/reduce_errors_validator.rb @@ -5,7 +5,6 @@ def validate_each(record, attribute, _value) errors = record.errors return until errors.messages.key? attribute - error = errors[attribute] - error.slice!(-1) until error.size <= 1 + errors.objects.uniq!(&:attribute) end end