From ecdcfe4d5c230e6c5cb56642a9b8106fae54013c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 20:45:50 +0000 Subject: [PATCH 01/39] chore(deps): update dependency rails to v8 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 3d9c3724..9ba96ca7 100644 --- a/Gemfile +++ b/Gemfile @@ -32,7 +32,7 @@ gem 'puma', '~> 6.0' gem 'pundit', '~> 2.4' gem 'rack-attack', '~> 6.7' gem 'rack-cors', '~> 2.0', '>= 2.0.2', require: 'rack/cors' -gem 'rails', '~> 7.0', '>= 7.0.4.3' +gem 'rails', '~> 8.0', '>= 8.0.1' gem 'rails-i18n', '~> 7.0', '>= 7.0.10' gem 'redis', '~> 4.8', '>= 4.8.1' gem 'roo', '~> 2.10', '>= 2.10.1' From e829eb6a7a48cbe6db5dede436eead646676fb9f Mon Sep 17 00:00:00 2001 From: lodewiges <131907615+lodewiges@users.noreply.github.com> Date: Sun, 19 Jan 2025 15:21:54 +0100 Subject: [PATCH 02/39] Update Gemfile --- Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 9ba96ca7..9278e229 100644 --- a/Gemfile +++ b/Gemfile @@ -33,7 +33,7 @@ gem 'pundit', '~> 2.4' gem 'rack-attack', '~> 6.7' gem 'rack-cors', '~> 2.0', '>= 2.0.2', require: 'rack/cors' gem 'rails', '~> 8.0', '>= 8.0.1' -gem 'rails-i18n', '~> 7.0', '>= 7.0.10' +gem 'rails-i18n', '~> 8.0', '>= 8.0.0' gem 'redis', '~> 4.8', '>= 4.8.1' gem 'roo', '~> 2.10', '>= 2.10.1' gem 'ruby-filemagic', '~> 0.7', '>= 0.7.3' @@ -43,7 +43,7 @@ gem 'sepa_king', '~> 0.14' gem 'sidekiq', '~> 6.5', '>= 6.5.12' gem 'sidekiq-scheduler', '~> 5.0', '>= 5.0.6' gem 'slack-notifier', '~> 2.4' -gem 'validates_timeliness', '~> 7.0.0.beta2' +gem 'validates_timeliness', '~> 8.0.0' gem 'vpim', '~> 24.2', '>= 24.2.20' group :development, :test do From e4c42155672c515cc39e452ca4d3b4fece441cd6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 16 Feb 2025 12:59:26 +0000 Subject: [PATCH 03/39] chore(deps): update dependency rails to v8 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 9d3b7af5..bbf4fa96 100644 --- a/Gemfile +++ b/Gemfile @@ -33,7 +33,7 @@ gem 'puma', '~> 6.5' gem 'pundit', '~> 2.4' gem 'rack-attack', '~> 6.7' gem 'rack-cors', '~> 2.0', '>= 2.0.2', require: 'rack/cors' -gem 'rails', '~> 7.0.0', '>= 7.0.8.7' +gem 'rails', '~> 8.0.1' gem 'rails-i18n', '~> 7.0', '>= 7.0.10' gem 'redis', '~> 5.3' gem 'roo', '~> 2.10', '>= 2.10.1' From 2d22dbf6728676aaa5d81fa2272d5a8222290e49 Mon Sep 17 00:00:00 2001 From: Jorai Geertsema Date: Sun, 16 Feb 2025 19:40:46 +0100 Subject: [PATCH 04/39] generated gem.lock file --- Gemfile.lock | 207 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 123 insertions(+), 84 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e6da3a78..84443919 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -13,74 +13,80 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.0.8.7) - actionpack (= 7.0.8.7) - activesupport (= 7.0.8.7) + actioncable (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.8.7) - actionpack (= 7.0.8.7) - activejob (= 7.0.8.7) - activerecord (= 7.0.8.7) - activestorage (= 7.0.8.7) - activesupport (= 7.0.8.7) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.0.8.7) - actionpack (= 7.0.8.7) - actionview (= 7.0.8.7) - activejob (= 7.0.8.7) - activesupport (= 7.0.8.7) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.8.7) - actionview (= 7.0.8.7) - activesupport (= 7.0.8.7) - rack (~> 2.0, >= 2.2.4) + zeitwerk (~> 2.6) + actionmailbox (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) + mail (>= 2.8.0) + actionmailer (8.0.1) + actionpack (= 8.0.1) + actionview (= 8.0.1) + activejob (= 8.0.1) + activesupport (= 8.0.1) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (8.0.1) + actionview (= 8.0.1) + activesupport (= 8.0.1) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.8.7) - actionpack (= 7.0.8.7) - activerecord (= 7.0.8.7) - activestorage (= 7.0.8.7) - activesupport (= 7.0.8.7) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (8.0.1) + actionpack (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.8.7) - activesupport (= 7.0.8.7) + actionview (8.0.1) + activesupport (= 8.0.1) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) active_model_otp (2.3.4) activemodel rotp (~> 6.3.0) - activejob (7.0.8.7) - activesupport (= 7.0.8.7) + activejob (8.0.1) + activesupport (= 8.0.1) globalid (>= 0.3.6) - activemodel (7.0.8.7) - activesupport (= 7.0.8.7) - activerecord (7.0.8.7) - activemodel (= 7.0.8.7) - activesupport (= 7.0.8.7) - activestorage (7.0.8.7) - actionpack (= 7.0.8.7) - activejob (= 7.0.8.7) - activerecord (= 7.0.8.7) - activesupport (= 7.0.8.7) + activemodel (8.0.1) + activesupport (= 8.0.1) + activerecord (8.0.1) + activemodel (= 8.0.1) + activesupport (= 8.0.1) + timeout (>= 0.4.0) + activestorage (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activesupport (= 8.0.1) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.8.7) - concurrent-ruby (~> 1.0, >= 1.0.2) + activesupport (8.0.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - tzinfo (~> 2.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) @@ -93,6 +99,8 @@ GEM coderay (>= 1.0.0) erubi (>= 1.0.0) rack (>= 0.9.0) + bigdecimal (3.1.9) + bigdecimal (3.1.9-java) binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) bootsnap (1.18.4) @@ -150,6 +158,7 @@ GEM dotenv-rails (2.7.6) dotenv (= 2.7.6) railties (>= 3.2) + drb (2.2.1) erubi (1.13.0) et-orbi (1.2.11) tzinfo @@ -221,8 +230,15 @@ GEM ruby-vips (>= 2.0.17, < 3) improvmx (0.2.1) rest-client (~> 2.0) + io-console (0.8.0) + io-console (0.8.0-java) + irb (1.15.1) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) isbn_validation (1.2.2) activerecord (>= 3) + jar-dependencies (0.5.5) jsonapi-authorization (3.0.2) jsonapi-resources (~> 0.9.0) pundit (>= 1.0.0, < 3.0.0) @@ -265,14 +281,14 @@ GEM msgpack (1.7.5) msgpack (1.7.5-java) nenv (0.3.0) - net-imap (0.5.5) + net-imap (0.5.6) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) timeout - net-smtp (0.5.0) + net-smtp (0.5.1) net-protocol netrc (0.11.0) nio4r (2.7.4) @@ -295,6 +311,9 @@ GEM ast (~> 2.4.1) pg (1.5.9) phonelib (0.6.58) + pp (0.6.2) + prettyprint + prettyprint (0.2.0) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) @@ -307,6 +326,12 @@ GEM pry (>= 0.13, < 0.15) pry-rails (0.3.11) pry (>= 0.13.0) + psych (5.2.3) + date + stringio + psych (5.2.3-java) + date + jar-dependencies (>= 0.1.7) public_suffix (6.0.1) puma (6.5.0) nio4r (~> 2.0) @@ -324,22 +349,27 @@ GEM rack (>= 2.0.0) rack-mini-profiler (3.0.0) rack (>= 1.2.0) + rack-session (1.0.2) + rack (< 3) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.8.7) - actioncable (= 7.0.8.7) - actionmailbox (= 7.0.8.7) - actionmailer (= 7.0.8.7) - actionpack (= 7.0.8.7) - actiontext (= 7.0.8.7) - actionview (= 7.0.8.7) - activejob (= 7.0.8.7) - activemodel (= 7.0.8.7) - activerecord (= 7.0.8.7) - activestorage (= 7.0.8.7) - activesupport (= 7.0.8.7) + rackup (1.0.1) + rack (< 3) + webrick + rails (8.0.1) + actioncable (= 8.0.1) + actionmailbox (= 8.0.1) + actionmailer (= 8.0.1) + actionpack (= 8.0.1) + actiontext (= 8.0.1) + actionview (= 8.0.1) + activejob (= 8.0.1) + activemodel (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) bundler (>= 1.15.0) - railties (= 7.0.8.7) + railties (= 8.0.1) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -347,27 +377,32 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - rails-i18n (7.0.10) + rails-i18n (8.0.1) i18n (>= 0.7, < 2) - railties (>= 6.0.0, < 8) - railties (7.0.8.7) - actionpack (= 7.0.8.7) - activesupport (= 7.0.8.7) - method_source + railties (>= 8.0.0, < 9) + railties (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) + irb (~> 1.13) + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.2.1) rb-fsevent (0.11.1) rb-inotify (0.10.1) ffi (~> 1.0) rb-readline (0.5.5) + rdoc (6.12.0) + psych (>= 4.0.0) redis (5.3.0) redis-client (>= 0.22.0) redis-client (0.23.0) connection_pool regexp_parser (2.2.1) + reline (0.6.0) + io-console (~> 0.5) request_store (1.7.0) rack (>= 1.4) rest-client (2.1.0) @@ -448,6 +483,7 @@ GEM rubyzip (2.3.2) rufus-scheduler (3.9.2) fugit (~> 1.1, >= 1.11.1) + securerandom (0.4.1) sentry-raven (3.1.2) faraday (>= 1.0) sepa_king (0.14.0) @@ -481,11 +517,12 @@ GEM listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) ssrf_filter (1.2.0) + stringio (3.1.3) terminal-notifier-guard (1.7.0) thor (1.3.2) tilt (2.4.0) timecop (0.9.5) - timeliness (0.5.1) + timeliness (0.5.2) timeout (0.4.3) tzinfo (2.0.6) concurrent-ruby (~> 1.0) @@ -499,11 +536,13 @@ GEM unf_ext (0.0.8.1-x86-mingw32) unicode-display_width (2.1.0) uniform_notifier (1.16.0) + uri (1.0.2) url_mount (0.2.1) rack + useragent (0.16.11) uuidtools (2.2.0) - validates_timeliness (7.0.0) - activemodel (>= 7.0.0, < 8) + validates_timeliness (8.0.0) + activemodel (>= 8.0.0, < 9) timeliness (>= 0.3.10, < 1) vcard_parser (0.0.9) vcr (6.1.0) @@ -579,8 +618,8 @@ DEPENDENCIES rack-attack (~> 6.7) rack-cors (~> 2.0, >= 2.0.2) rack-mini-profiler - rails (~> 7.0.0, >= 7.0.8.7) - rails-i18n (~> 7.0, >= 7.0.10) + rails (~> 8.0, >= 8.0.1) + rails-i18n (~> 8.0, >= 8.0.0) rb-readline redis (~> 5.3) roo (~> 2.10, >= 2.10.1) @@ -604,7 +643,7 @@ DEPENDENCIES terminal-notifier-guard timecop tzinfo-data - validates_timeliness (~> 7.0.0) + validates_timeliness (~> 8.0.0) vcr vpim (~> 24.2, >= 24.2.20) webmock From 4a49cf29f184a14f0818b311dafeddebe1071a71 Mon Sep 17 00:00:00 2001 From: Jorai Geertsema Date: Sun, 16 Feb 2025 19:48:05 +0100 Subject: [PATCH 05/39] Fixes build failure --- Gemfile.lock | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 45503183..db485c5b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -252,7 +252,7 @@ GEM llhttp-ffi (0.5.0) ffi-compiler (~> 1.0) rake (~> 13.0) - logger (1.6.5) + logger (1.6.6) loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -281,7 +281,6 @@ GEM msgpack (1.7.5) msgpack (1.7.5-java) nenv (0.3.0) - net-imap (0.5.6) net-imap (0.5.6) date net-protocol @@ -289,7 +288,6 @@ GEM net-protocol net-protocol (0.2.2) timeout - net-smtp (0.5.1) net-smtp (0.5.1) net-protocol netrc (0.11.0) @@ -544,8 +542,6 @@ GEM rack useragent (0.16.11) uuidtools (2.2.0) - validates_timeliness (7.1.0) - activemodel (>= 7.0.0, < 8) validates_timeliness (8.0.0) activemodel (>= 8.0.0, < 9) timeliness (>= 0.3.10, < 1) @@ -648,7 +644,6 @@ DEPENDENCIES terminal-notifier-guard timecop tzinfo-data - validates_timeliness (~> 7.1.0) validates_timeliness (~> 8.0.0) vcr vpim (~> 24.2, >= 24.2.20) From 528ed50be264b31f38b66a8affe8362de02d2d7a Mon Sep 17 00:00:00 2001 From: Jorai Geertsema Date: Fri, 28 Feb 2025 23:38:46 +0100 Subject: [PATCH 06/39] Fix build error --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 88f260fa..22eff3b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,7 @@ RUN apk add --update \ tzdata \ libffi-dev \ build-base \ + yaml-dev \ && rm -rf /var/cache/apk/* RUN mkdir /app From 1a4837b6ed531f14231a239808c0c77c86b92e2a Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Wed, 19 Mar 2025 12:17:31 +0100 Subject: [PATCH 07/39] fix gemfile.lock --- Gemfile.lock | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 7c1427ca..364e974e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -88,8 +88,8 @@ GEM rack (>= 0.9.0) bigdecimal (3.1.9) bigdecimal (3.1.9-java) - binding_of_caller (1.0.0) - debug_inspector (>= 0.0.1) + binding_of_caller (1.0.1) + debug_inspector (>= 1.2.0) bootsnap (1.18.4) msgpack (~> 1.2) brakeman (7.0.0) @@ -264,7 +264,6 @@ GEM minitest (5.25.5) msgpack (1.8.0) msgpack (1.8.0-java) - mutex_m (0.3.0) nenv (0.3.0) net-imap (0.5.6) date @@ -422,7 +421,6 @@ GEM nokogiri (~> 1) rubyzip (>= 1.3.0, < 3.0.0) rotp (6.3.0) - rouge (4.5.1) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) @@ -542,10 +540,7 @@ GEM unicode-emoji (4.0.4) uniform_notifier (1.16.0) uri (1.0.2) - url_mount (0.2.1) - rack useragent (0.16.11) - uuidtools (2.2.0) validates_timeliness (8.0.0) activemodel (>= 8.0.0, < 9) timeliness (>= 0.3.10, < 1) @@ -589,7 +584,7 @@ DEPENDENCIES colorize (~> 1.1) consistency_fail counter_culture (~> 3.8, >= 3.8.2) - csv (~> 3.3) + csv (~> 3.3, >= 3.3.2) doorkeeper (~> 5.8, >= 5.8.1) doorkeeper-i18n (~> 5.2, >= 5.2.7) dotenv-rails (~> 3.1, >= 3.1.7) From 1fde5efc5fc4fdc64ea8fab8a4b2ec91c010397f Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Wed, 19 Mar 2025 12:52:38 +0100 Subject: [PATCH 08/39] Intial commit --- Gemfile | 2 +- Gemfile.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 1304ac79..5323a5dc 100644 --- a/Gemfile +++ b/Gemfile @@ -30,7 +30,7 @@ gem 'puma', '~> 6.6' gem 'pundit', '~> 2.5' gem 'rack-attack', '~> 6.7' gem 'rack-cors', '~> 2.0', '>= 2.0.2', require: 'rack/cors' -gem 'rails', '~> 7.1.0', '>= 7.1.5.1' +gem 'rails', '~> 7.2.2', '>= 7.2.2.1' gem 'rails-i18n', '~> 7.0', '>= 7.0.10' gem 'redis', '~> 5.4' gem 'roo', '~> 2.10', '>= 2.10.1' diff --git a/Gemfile.lock b/Gemfile.lock index 32cec7c1..1cd0567e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -591,7 +591,7 @@ DEPENDENCIES colorize (~> 1.1) consistency_fail counter_culture (~> 3.8, >= 3.8.2) - csv (~> 3.3) + csv (~> 3.3, >= 3.3.2) doorkeeper (~> 5.8, >= 5.8.1) doorkeeper-i18n (~> 5.2, >= 5.2.7) dotenv-rails (~> 3.1, >= 3.1.7) From 51dcd9fee2d47010ce41be521f80abce1d9c3a77 Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Wed, 19 Mar 2025 12:55:29 +0100 Subject: [PATCH 09/39] generated gemfile.lock --- Gemfile.lock | 149 ++++++++++++++++++++++++--------------------------- 1 file changed, 71 insertions(+), 78 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1cd0567e..33a2a044 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,51 +1,46 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.1.5.1) - actionpack (= 7.1.5.1) - activesupport (= 7.1.5.1) + actioncable (7.2.2.1) + actionpack (= 7.2.2.1) + activesupport (= 7.2.2.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.5.1) - actionpack (= 7.1.5.1) - activejob (= 7.1.5.1) - activerecord (= 7.1.5.1) - activestorage (= 7.1.5.1) - activesupport (= 7.1.5.1) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.1.5.1) - actionpack (= 7.1.5.1) - actionview (= 7.1.5.1) - activejob (= 7.1.5.1) - activesupport (= 7.1.5.1) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp + actionmailbox (7.2.2.1) + actionpack (= 7.2.2.1) + activejob (= 7.2.2.1) + activerecord (= 7.2.2.1) + activestorage (= 7.2.2.1) + activesupport (= 7.2.2.1) + mail (>= 2.8.0) + actionmailer (7.2.2.1) + actionpack (= 7.2.2.1) + actionview (= 7.2.2.1) + activejob (= 7.2.2.1) + activesupport (= 7.2.2.1) + mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.1.5.1) - actionview (= 7.1.5.1) - activesupport (= 7.1.5.1) + actionpack (7.2.2.1) + actionview (= 7.2.2.1) + activesupport (= 7.2.2.1) nokogiri (>= 1.8.5) racc - rack (>= 2.2.4) + rack (>= 2.2.4, < 3.2) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.5.1) - actionpack (= 7.1.5.1) - activerecord (= 7.1.5.1) - activestorage (= 7.1.5.1) - activesupport (= 7.1.5.1) + useragent (~> 0.16) + actiontext (7.2.2.1) + actionpack (= 7.2.2.1) + activerecord (= 7.2.2.1) + activestorage (= 7.2.2.1) + activesupport (= 7.2.2.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.5.1) - activesupport (= 7.1.5.1) + actionview (7.2.2.1) + activesupport (= 7.2.2.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) @@ -53,34 +48,33 @@ GEM active_model_otp (2.3.4) activemodel rotp (~> 6.3.0) - activejob (7.1.5.1) - activesupport (= 7.1.5.1) + activejob (7.2.2.1) + activesupport (= 7.2.2.1) globalid (>= 0.3.6) - activemodel (7.1.5.1) - activesupport (= 7.1.5.1) - activerecord (7.1.5.1) - activemodel (= 7.1.5.1) - activesupport (= 7.1.5.1) + activemodel (7.2.2.1) + activesupport (= 7.2.2.1) + activerecord (7.2.2.1) + activemodel (= 7.2.2.1) + activesupport (= 7.2.2.1) timeout (>= 0.4.0) - activestorage (7.1.5.1) - actionpack (= 7.1.5.1) - activejob (= 7.1.5.1) - activerecord (= 7.1.5.1) - activesupport (= 7.1.5.1) + activestorage (7.2.2.1) + actionpack (= 7.2.2.1) + activejob (= 7.2.2.1) + activerecord (= 7.2.2.1) + activesupport (= 7.2.2.1) marcel (~> 1.0) - activesupport (7.1.5.1) + activesupport (7.2.2.1) base64 benchmark (>= 0.3) bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) logger (>= 1.4.2) minitest (>= 5.1) - mutex_m securerandom (>= 0.3) - tzinfo (~> 2.0) + tzinfo (~> 2.0, >= 2.0.5) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) @@ -271,7 +265,6 @@ GEM minitest (5.25.5) msgpack (1.8.0) msgpack (1.8.0-java) - mutex_m (0.3.0) nenv (0.3.0) net-imap (0.5.6) date @@ -285,12 +278,12 @@ GEM netrc (0.11.0) nio4r (2.7.4) nio4r (2.7.4-java) - nokogiri (1.18.3) + nokogiri (1.18.4) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.18.3-java) + nokogiri (1.18.4-java) racc (~> 1.4) - nokogiri (1.18.3-x86_64-linux-gnu) + nokogiri (1.18.4-x86_64-linux-gnu) racc (~> 1.4) notiffany (0.1.3) nenv (~> 0.1) @@ -338,34 +331,34 @@ GEM raabro (1.4.0) racc (1.8.1) racc (1.8.1-java) - rack (2.2.12) + rack (3.1.12) rack-attack (6.7.0) rack (>= 1.0, < 4) rack-cors (2.0.2) rack (>= 2.0.0) rack-mini-profiler (3.3.1) rack (>= 1.2.0) - rack-session (1.0.2) - rack (< 3) + rack-session (2.1.0) + base64 (>= 0.1.0) + rack (>= 3.0.0) rack-test (2.2.0) rack (>= 1.3) - rackup (1.0.1) - rack (< 3) - webrick - rails (7.1.5.1) - actioncable (= 7.1.5.1) - actionmailbox (= 7.1.5.1) - actionmailer (= 7.1.5.1) - actionpack (= 7.1.5.1) - actiontext (= 7.1.5.1) - actionview (= 7.1.5.1) - activejob (= 7.1.5.1) - activemodel (= 7.1.5.1) - activerecord (= 7.1.5.1) - activestorage (= 7.1.5.1) - activesupport (= 7.1.5.1) + rackup (2.2.1) + rack (>= 3) + rails (7.2.2.1) + actioncable (= 7.2.2.1) + actionmailbox (= 7.2.2.1) + actionmailer (= 7.2.2.1) + actionpack (= 7.2.2.1) + actiontext (= 7.2.2.1) + actionview (= 7.2.2.1) + activejob (= 7.2.2.1) + activemodel (= 7.2.2.1) + activerecord (= 7.2.2.1) + activestorage (= 7.2.2.1) + activesupport (= 7.2.2.1) bundler (>= 1.15.0) - railties (= 7.1.5.1) + railties (= 7.2.2.1) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -376,10 +369,10 @@ GEM rails-i18n (7.0.10) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.1.5.1) - actionpack (= 7.1.5.1) - activesupport (= 7.1.5.1) - irb + railties (7.2.2.1) + actionpack (= 7.2.2.1) + activesupport (= 7.2.2.1) + irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) @@ -548,6 +541,7 @@ GEM unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) uniform_notifier (1.16.0) + useragent (0.16.11) validates_timeliness (7.1.0) activemodel (>= 7.0.0, < 8) timeliness (>= 0.3.10, < 1) @@ -558,7 +552,6 @@ GEM addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - webrick (1.9.1) websocket-driver (0.7.7) base64 websocket-extensions (>= 0.1.0) @@ -623,7 +616,7 @@ DEPENDENCIES rack-attack (~> 6.7) rack-cors (~> 2.0, >= 2.0.2) rack-mini-profiler (~> 3.3, >= 3.3.1) - rails (~> 7.1.0, >= 7.1.5.1) + rails (~> 7.2.2, >= 7.2.2.1) rails-i18n (~> 7.0, >= 7.0.10) rb-readline (~> 0.5, >= 0.5.5) redis (~> 5.4) From be9f69e2eb84ec578c644e550fae0d32c3ad6658 Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Wed, 19 Mar 2025 13:05:05 +0100 Subject: [PATCH 10/39] update rspec-rails --- .rubocop.yml | 2 +- Gemfile | 2 +- Gemfile.lock | 10 +++++----- config/application.rb | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index c0b35e45..1404d975 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,7 +6,7 @@ plugins: - rubocop-rspec_rails AllCops: - TargetRailsVersion: 7.1 + TargetRailsVersion: 7.2 TargetRubyVersion: 3.3 Exclude: - 'db/schema.rb' diff --git a/Gemfile b/Gemfile index 5323a5dc..2e18e223 100644 --- a/Gemfile +++ b/Gemfile @@ -73,7 +73,7 @@ end group :test do gem 'guard-rspec', '~> 4.7', '>= 4.7.3', require: false - gem 'rspec-rails', '~> 6.1', '>= 6.1.5' + gem 'rspec-rails', '~> 7.1', '>= 7.1.1' gem 'rubocop', '~> 1.73', '>= 1.73.2', require: false gem 'rubocop-factory_bot', '~> 2.27', require: false gem 'rubocop-performance', '~> 1.24', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 33a2a044..b0075fc4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -435,10 +435,10 @@ GEM rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-rails (6.1.5) - actionpack (>= 6.1) - activesupport (>= 6.1) - railties (>= 6.1) + rspec-rails (7.1.1) + actionpack (>= 7.0) + activesupport (>= 7.0) + railties (>= 7.0) rspec-core (~> 3.13) rspec-expectations (~> 3.13) rspec-mocks (~> 3.13) @@ -621,7 +621,7 @@ DEPENDENCIES rb-readline (~> 0.5, >= 0.5.5) redis (~> 5.4) roo (~> 2.10, >= 2.10.1) - rspec-rails (~> 6.1, >= 6.1.5) + rspec-rails (~> 7.1, >= 7.1.1) rubocop (~> 1.73, >= 1.73.2) rubocop-factory_bot (~> 2.27) rubocop-performance (~> 1.24) diff --git a/config/application.rb b/config/application.rb index 659edc5e..f9a0d8ca 100644 --- a/config/application.rb +++ b/config/application.rb @@ -16,7 +16,7 @@ module Amber class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.0 + config.load_defaults 7.1 config.add_autoload_paths_to_load_path = false # Please, add to the `ignore` list any other `lib` subdirectories that do From 5b477c0e415cad31aa0214352a5a3ece4a2b485b Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Wed, 19 Mar 2025 13:15:43 +0100 Subject: [PATCH 11/39] update aplitaion.rb --- config/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index f9a0d8ca..f2245c29 100644 --- a/config/application.rb +++ b/config/application.rb @@ -16,7 +16,7 @@ module Amber class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.1 + config.load_defaults 7.2 config.add_autoload_paths_to_load_path = false # Please, add to the `ignore` list any other `lib` subdirectories that do From c4faf752e39523944d198bb7b04e1f54ffaec375 Mon Sep 17 00:00:00 2001 From: lodewiges <131907615+lodewiges@users.noreply.github.com> Date: Wed, 19 Mar 2025 13:21:12 +0100 Subject: [PATCH 12/39] Update application.rb --- config/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index f2245c29..f9a0d8ca 100644 --- a/config/application.rb +++ b/config/application.rb @@ -16,7 +16,7 @@ module Amber class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.2 + config.load_defaults 7.1 config.add_autoload_paths_to_load_path = false # Please, add to the `ignore` list any other `lib` subdirectories that do From 906faa73e7ed40946101b0e15956e5e388460f75 Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Wed, 19 Mar 2025 15:18:50 +0100 Subject: [PATCH 13/39] update sql to be more restrictive --- app/models/debit/mandate.rb | 20 +++++++++++--------- app/models/membership.rb | 26 ++++++++++++++------------ config/application.rb | 1 - config/environments/production.rb | 2 +- 4 files changed, 26 insertions(+), 23 deletions(-) diff --git a/app/models/debit/mandate.rb b/app/models/debit/mandate.rb index 66170b2c..4db5aad5 100644 --- a/app/models/debit/mandate.rb +++ b/app/models/debit/mandate.rb @@ -21,15 +21,17 @@ class Mandate < ApplicationRecord private def unique_on_time_interval? - return true unless Debit::Mandate.where.not(id:).where(user_id:) - .exists?([':start_date BETWEEN start_date AND end_date OR - :end_date BETWEEN start_date AND end_date OR - start_date BETWEEN :start_date AND :end_date OR - end_date BETWEEN :start_date AND :end_date OR - (start_date < :start_date AND end_date IS NULL) OR - (start_date > :start_date AND :end_date IS NULL)', - { start_date:, end_date: }]) - + return true unless Debit::Mandate.where.not(id: ) + .where(user_id: ) + .exists?([<<-SQL, { start_date: start_date, end_date: end_date }]) + CAST(:start_date AS date) BETWEEN start_date AND end_date OR + CAST(:end_date AS date) BETWEEN start_date AND end_date OR + start_date BETWEEN CAST(:start_date AS date) AND CAST(:end_date AS date) OR + end_date BETWEEN CAST(:start_date AS date) AND CAST(:end_date AS date) OR + (start_date < CAST(:start_date AS date) AND end_date IS NULL) OR + (start_date > CAST(:start_date AS date) AND CAST(:end_date AS date) IS NULL) + SQL + errors.add(:mandate, 'is not unique on time interval') false end diff --git a/app/models/membership.rb b/app/models/membership.rb index 8f58d645..ee50f46b 100644 --- a/app/models/membership.rb +++ b/app/models/membership.rb @@ -20,18 +20,20 @@ class Membership < ApplicationRecord private def unique_on_time_interval? - return true unless Membership.where.not(id:).where(group_id:, user_id:) - .exists?([':start_date BETWEEN start_date AND end_date OR - :end_date BETWEEN start_date AND end_date OR - start_date BETWEEN :start_date AND :end_date OR - end_date BETWEEN :start_date AND :end_date OR - (start_date < :start_date AND end_date IS NULL) OR - (start_date > :start_date AND :end_date IS NULL)', - { start_date:, end_date: }]) - - errors.add(:membership, 'is not unique on time interval') - false - end + return true unless Membership.where.not(id: id) + .where(group_id:, user_id: ) + .exists?([<<-SQL, { start_date: start_date, end_date: end_date }]) + CAST(:start_date AS date) BETWEEN start_date AND end_date OR + CAST(:end_date AS date) BETWEEN start_date AND end_date OR + start_date BETWEEN CAST(:start_date AS date) AND CAST(:end_date AS date) OR + end_date BETWEEN CAST(:start_date AS date) AND CAST(:end_date AS date) OR + (start_date < CAST(:start_date AS date) AND end_date IS NULL) OR + (start_date > CAST(:start_date AS date) AND CAST(:end_date AS date) IS NULL) + SQL + + errors.add(:membership, 'is not unique on time interval') + false +end # Remark, this will cause multiple updates when adding multiple users after each other # But this is quite hard to fix, but just be carefull diff --git a/config/application.rb b/config/application.rb index f9a0d8ca..0077f722 100644 --- a/config/application.rb +++ b/config/application.rb @@ -63,7 +63,6 @@ class Application < Rails::Application config.action_mailbox.ingress = :improvmx config.action_mailbox.incinerate_after = 7.days - config.active_job.queue_adapter = :sidekiq config.time_zone = 'Europe/Amsterdam' config.x.mail_domains = %w[csvalpha.nl societeitflux.nl] diff --git a/config/environments/production.rb b/config/environments/production.rb index 0fdc06d1..7e0baa70 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -57,7 +57,7 @@ # config.cache_store = :mem_cache_store # Use a real queuing backend for Active Job (and separate queues per environment). - # config.active_job.queue_adapter = :resque + config.active_job.queue_adapter = :sidekiq # config.active_job.queue_name_prefix = "amber_production" config.action_mailer.perform_caching = false From f66db19c74503af960d5f5b8e4f9a0698bee11f5 Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Wed, 19 Mar 2025 15:30:42 +0100 Subject: [PATCH 14/39] made some changes to tests --- app/models/debit/mandate.rb | 9 +++++---- app/models/membership.rb | 15 ++++++++------- spec/requests/v1/books_controller/update_spec.rb | 2 +- .../v1/forum/posts_controller/update_spec.rb | 2 +- spec/requests/v1/groups_controller/update_spec.rb | 2 +- .../v1/room_adverts_controller/update_spec.rb | 2 +- .../v1/static_pages_controller/update_spec.rb | 2 +- spec/requests/v1/users_controller/update_spec.rb | 2 +- .../v1/vacancies_controller/update_spec.rb | 2 +- .../requests/creatable_and_permissible_model.rb | 6 +++--- 10 files changed, 23 insertions(+), 21 deletions(-) diff --git a/app/models/debit/mandate.rb b/app/models/debit/mandate.rb index 4db5aad5..59c4eb81 100644 --- a/app/models/debit/mandate.rb +++ b/app/models/debit/mandate.rb @@ -21,17 +21,18 @@ class Mandate < ApplicationRecord private def unique_on_time_interval? - return true unless Debit::Mandate.where.not(id: ) - .where(user_id: ) + return true unless Debit::Mandate.where.not(id:) + .where(user_id:) .exists?([<<-SQL, { start_date: start_date, end_date: end_date }]) + CAST(:start_date AS date) BETWEEN start_date AND end_date OR CAST(:end_date AS date) BETWEEN start_date AND end_date OR start_date BETWEEN CAST(:start_date AS date) AND CAST(:end_date AS date) OR end_date BETWEEN CAST(:start_date AS date) AND CAST(:end_date AS date) OR (start_date < CAST(:start_date AS date) AND end_date IS NULL) OR (start_date > CAST(:start_date AS date) AND CAST(:end_date AS date) IS NULL) - SQL - + SQL + errors.add(:mandate, 'is not unique on time interval') false end diff --git a/app/models/membership.rb b/app/models/membership.rb index ee50f46b..5d5108eb 100644 --- a/app/models/membership.rb +++ b/app/models/membership.rb @@ -20,20 +20,21 @@ class Membership < ApplicationRecord private def unique_on_time_interval? - return true unless Membership.where.not(id: id) - .where(group_id:, user_id: ) - .exists?([<<-SQL, { start_date: start_date, end_date: end_date }]) + return true unless Membership.where.not(id: id) + .where(group_id:, user_id:) + .exists?([<<-SQL, { start_date: start_date, end_date: end_date }]) + CAST(:start_date AS date) BETWEEN start_date AND end_date OR CAST(:end_date AS date) BETWEEN start_date AND end_date OR start_date BETWEEN CAST(:start_date AS date) AND CAST(:end_date AS date) OR end_date BETWEEN CAST(:start_date AS date) AND CAST(:end_date AS date) OR (start_date < CAST(:start_date AS date) AND end_date IS NULL) OR (start_date > CAST(:start_date AS date) AND CAST(:end_date AS date) IS NULL) - SQL + SQL - errors.add(:membership, 'is not unique on time interval') - false -end + errors.add(:membership, 'is not unique on time interval') + false + end # Remark, this will cause multiple updates when adding multiple users after each other # But this is quite hard to fix, but just be carefull diff --git a/spec/requests/v1/books_controller/update_spec.rb b/spec/requests/v1/books_controller/update_spec.rb index 545a5ea7..56906701 100644 --- a/spec/requests/v1/books_controller/update_spec.rb +++ b/spec/requests/v1/books_controller/update_spec.rb @@ -6,7 +6,7 @@ let(:record_url) { "/v1/books/#{record.id}" } let(:record_permission) { 'book.update' } - it_behaves_like 'an updatable and permissible model', response: :ok do + it_behaves_like 'an updatable and permissible model' do let(:invalid_attributes) { { title: '' } } end end diff --git a/spec/requests/v1/forum/posts_controller/update_spec.rb b/spec/requests/v1/forum/posts_controller/update_spec.rb index 79103bad..d5b93a32 100644 --- a/spec/requests/v1/forum/posts_controller/update_spec.rb +++ b/spec/requests/v1/forum/posts_controller/update_spec.rb @@ -6,7 +6,7 @@ let(:record_url) { "/v1/forum/posts/#{record.id}" } let(:record_permission) { 'forum/post.update' } - it_behaves_like 'an updatable and permissible model', response: :ok do + it_behaves_like 'an updatable and permissible model' do let(:invalid_attributes) { { message: '' } } end diff --git a/spec/requests/v1/groups_controller/update_spec.rb b/spec/requests/v1/groups_controller/update_spec.rb index 6e7eb8fe..e8479287 100644 --- a/spec/requests/v1/groups_controller/update_spec.rb +++ b/spec/requests/v1/groups_controller/update_spec.rb @@ -8,7 +8,7 @@ subject(:request) { put(record_url) } - it_behaves_like 'an updatable and permissible model', response: :ok do + it_behaves_like 'an updatable and permissible model' do let(:invalid_attributes) { { name: '' } } end diff --git a/spec/requests/v1/room_adverts_controller/update_spec.rb b/spec/requests/v1/room_adverts_controller/update_spec.rb index 1a590632..d6f980cf 100644 --- a/spec/requests/v1/room_adverts_controller/update_spec.rb +++ b/spec/requests/v1/room_adverts_controller/update_spec.rb @@ -6,7 +6,7 @@ let(:record_url) { "/v1/room_adverts/#{record.id}" } let(:record_permission) { 'room_advert.update' } - it_behaves_like 'an updatable and permissible model', response: :ok do + it_behaves_like 'an updatable and permissible model' do let(:invalid_attributes) { { house_name: '' } } end diff --git a/spec/requests/v1/static_pages_controller/update_spec.rb b/spec/requests/v1/static_pages_controller/update_spec.rb index 1f07837a..09a9b4df 100644 --- a/spec/requests/v1/static_pages_controller/update_spec.rb +++ b/spec/requests/v1/static_pages_controller/update_spec.rb @@ -2,7 +2,7 @@ describe V1::StaticPagesController do describe 'PUT /static_pages/:slug', version: 1 do - it_behaves_like 'an updatable and permissible model', response: :ok do + it_behaves_like 'an updatable and permissible model' do let(:record) { create(:static_page) } let(:record_url) { "/v1/static_pages/#{record.id}" } let(:record_permission) { 'static_page.update' } diff --git a/spec/requests/v1/users_controller/update_spec.rb b/spec/requests/v1/users_controller/update_spec.rb index 5f0967c6..8a5a7a80 100644 --- a/spec/requests/v1/users_controller/update_spec.rb +++ b/spec/requests/v1/users_controller/update_spec.rb @@ -6,7 +6,7 @@ let(:record_url) { "/v1/users/#{record.id}" } let(:record_permission) { 'user.update' } - it_behaves_like 'an updatable and permissible model', response: :ok do + it_behaves_like 'an updatable and permissible model' do let(:invalid_attributes) { { email: '' } } end diff --git a/spec/requests/v1/vacancies_controller/update_spec.rb b/spec/requests/v1/vacancies_controller/update_spec.rb index 95ba2154..1d546beb 100644 --- a/spec/requests/v1/vacancies_controller/update_spec.rb +++ b/spec/requests/v1/vacancies_controller/update_spec.rb @@ -6,7 +6,7 @@ let(:record_url) { "/v1/vacancies/#{record.id}" } let(:record_permission) { 'vacancy.update' } - it_behaves_like 'an updatable and permissible model', response: :ok do + it_behaves_like 'an updatable and permissible model' do let(:invalid_attributes) { { title: '' } } end diff --git a/spec/support/behaviors/requests/creatable_and_permissible_model.rb b/spec/support/behaviors/requests/creatable_and_permissible_model.rb index 799152f9..daae8642 100644 --- a/spec/support/behaviors/requests/creatable_and_permissible_model.rb +++ b/spec/support/behaviors/requests/creatable_and_permissible_model.rb @@ -1,4 +1,4 @@ -shared_examples 'a creatable and permissible model' do |incorrect_data_response_behaves_like: '422 Unprocessable Entity'| # rubocop:disable Layout/LineLength +shared_examples 'a creatable and permissible model' let(:valid_attributes) { record.attributes } let(:valid_relationships) { {} } let(:invalid_attributes) { valid_attributes } @@ -48,7 +48,7 @@ context 'when using incorrect data' do subject(:request) { invalid_request } - it_behaves_like incorrect_data_response_behaves_like + it_behaves_like '422 Unprocessable Entity' it { expect { request }.not_to(change { record.class.count }) } end end @@ -64,7 +64,7 @@ context 'when using incorrect data' do subject(:request) { invalid_request } - it_behaves_like incorrect_data_response_behaves_like + it_behaves_like '422 Unprocessable Entity' it { expect { request }.not_to(change { record.class.count }) } end end From a8d2cfb0ad66052ad5cb336e3d5905d81fdfa747 Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Wed, 19 Mar 2025 15:36:43 +0100 Subject: [PATCH 15/39] fix typo --- .../behaviors/requests/creatable_and_permissible_model.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/behaviors/requests/creatable_and_permissible_model.rb b/spec/support/behaviors/requests/creatable_and_permissible_model.rb index daae8642..efdc7443 100644 --- a/spec/support/behaviors/requests/creatable_and_permissible_model.rb +++ b/spec/support/behaviors/requests/creatable_and_permissible_model.rb @@ -1,4 +1,4 @@ -shared_examples 'a creatable and permissible model' +shared_examples 'a creatable and permissible model' do let(:valid_attributes) { record.attributes } let(:valid_relationships) { {} } let(:invalid_attributes) { valid_attributes } From 3d165a2508177e9011a93e45f413be4460810085 Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Wed, 19 Mar 2025 15:44:00 +0100 Subject: [PATCH 16/39] tried alternating some stuff --- .../behaviors/requests/creatable_and_permissible_model.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/support/behaviors/requests/creatable_and_permissible_model.rb b/spec/support/behaviors/requests/creatable_and_permissible_model.rb index efdc7443..d31ec27b 100644 --- a/spec/support/behaviors/requests/creatable_and_permissible_model.rb +++ b/spec/support/behaviors/requests/creatable_and_permissible_model.rb @@ -48,7 +48,7 @@ context 'when using incorrect data' do subject(:request) { invalid_request } - it_behaves_like '422 Unprocessable Entity' + it_behaves_like '422 Unprocessable Entity in Plain Text' it { expect { request }.not_to(change { record.class.count }) } end end @@ -64,7 +64,7 @@ context 'when using incorrect data' do subject(:request) { invalid_request } - it_behaves_like '422 Unprocessable Entity' + it_behaves_like '422 Unprocessable Entity in Plain Text' it { expect { request }.not_to(change { record.class.count }) } end end From 1d49cd48b8bac61a3377e46f53ceaec2179e9635 Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Wed, 19 Mar 2025 17:06:20 +0100 Subject: [PATCH 17/39] tried downgrading rspec --- Gemfile | 2 +- Gemfile.lock | 10 +++++----- app/models/debit/mandate.rb | 4 ++-- app/models/membership.rb | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index 2e18e223..b54d5d4a 100644 --- a/Gemfile +++ b/Gemfile @@ -73,7 +73,7 @@ end group :test do gem 'guard-rspec', '~> 4.7', '>= 4.7.3', require: false - gem 'rspec-rails', '~> 7.1', '>= 7.1.1' + gem 'rspec-rails', '~> 7.0.0', '>= 7.0.2' gem 'rubocop', '~> 1.73', '>= 1.73.2', require: false gem 'rubocop-factory_bot', '~> 2.27', require: false gem 'rubocop-performance', '~> 1.24', require: false diff --git a/Gemfile.lock b/Gemfile.lock index b0075fc4..ec3658d2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -278,12 +278,12 @@ GEM netrc (0.11.0) nio4r (2.7.4) nio4r (2.7.4-java) - nokogiri (1.18.4) + nokogiri (1.18.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.18.4-java) + nokogiri (1.18.5-java) racc (~> 1.4) - nokogiri (1.18.4-x86_64-linux-gnu) + nokogiri (1.18.5-x86_64-linux-gnu) racc (~> 1.4) notiffany (0.1.3) nenv (~> 0.1) @@ -435,7 +435,7 @@ GEM rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-rails (7.1.1) + rspec-rails (7.0.2) actionpack (>= 7.0) activesupport (>= 7.0) railties (>= 7.0) @@ -621,7 +621,7 @@ DEPENDENCIES rb-readline (~> 0.5, >= 0.5.5) redis (~> 5.4) roo (~> 2.10, >= 2.10.1) - rspec-rails (~> 7.1, >= 7.1.1) + rspec-rails (~> 7.0.0, >= 7.0.0) rubocop (~> 1.73, >= 1.73.2) rubocop-factory_bot (~> 2.27) rubocop-performance (~> 1.24) diff --git a/app/models/debit/mandate.rb b/app/models/debit/mandate.rb index 59c4eb81..f35545fc 100644 --- a/app/models/debit/mandate.rb +++ b/app/models/debit/mandate.rb @@ -20,10 +20,10 @@ class Mandate < ApplicationRecord private - def unique_on_time_interval? + def unique_on_time_interval? # rubocop:disable Metrics/MethodLength return true unless Debit::Mandate.where.not(id:) .where(user_id:) - .exists?([<<-SQL, { start_date: start_date, end_date: end_date }]) + .exists?([<<-SQL.squish, { start_date: start_date, end_date: end_date }]) CAST(:start_date AS date) BETWEEN start_date AND end_date OR CAST(:end_date AS date) BETWEEN start_date AND end_date OR diff --git a/app/models/membership.rb b/app/models/membership.rb index 5d5108eb..a36587c5 100644 --- a/app/models/membership.rb +++ b/app/models/membership.rb @@ -19,10 +19,10 @@ class Membership < ApplicationRecord private - def unique_on_time_interval? + def unique_on_time_interval? # rubocop:disable Metrics/MethodLength return true unless Membership.where.not(id: id) .where(group_id:, user_id:) - .exists?([<<-SQL, { start_date: start_date, end_date: end_date }]) + .exists?([<<-SQL.squish, { start_date: start_date, end_date: end_date }]) CAST(:start_date AS date) BETWEEN start_date AND end_date OR CAST(:end_date AS date) BETWEEN start_date AND end_date OR From 331c4dede3bb126fbcee539dafb4f157400b1672 Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Wed, 19 Mar 2025 17:11:23 +0100 Subject: [PATCH 18/39] downgrading rspec to v6 --- Gemfile | 2 +- Gemfile.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index b54d5d4a..5323a5dc 100644 --- a/Gemfile +++ b/Gemfile @@ -73,7 +73,7 @@ end group :test do gem 'guard-rspec', '~> 4.7', '>= 4.7.3', require: false - gem 'rspec-rails', '~> 7.0.0', '>= 7.0.2' + gem 'rspec-rails', '~> 6.1', '>= 6.1.5' gem 'rubocop', '~> 1.73', '>= 1.73.2', require: false gem 'rubocop-factory_bot', '~> 2.27', require: false gem 'rubocop-performance', '~> 1.24', require: false diff --git a/Gemfile.lock b/Gemfile.lock index ec3658d2..f56a0a1f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -435,10 +435,10 @@ GEM rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-rails (7.0.2) - actionpack (>= 7.0) - activesupport (>= 7.0) - railties (>= 7.0) + rspec-rails (6.1.5) + actionpack (>= 6.1) + activesupport (>= 6.1) + railties (>= 6.1) rspec-core (~> 3.13) rspec-expectations (~> 3.13) rspec-mocks (~> 3.13) @@ -621,7 +621,7 @@ DEPENDENCIES rb-readline (~> 0.5, >= 0.5.5) redis (~> 5.4) roo (~> 2.10, >= 2.10.1) - rspec-rails (~> 7.0.0, >= 7.0.0) + rspec-rails (~> 6.1, >= 6.1.5) rubocop (~> 1.73, >= 1.73.2) rubocop-factory_bot (~> 2.27) rubocop-performance (~> 1.24) From c8e9fd6cd5f0ba4993144423a3f75027ce128e9f Mon Sep 17 00:00:00 2001 From: lodewiges <131907615+lodewiges@users.noreply.github.com> Date: Wed, 19 Mar 2025 20:33:48 +0100 Subject: [PATCH 19/39] Update Gemfile.lock --- Gemfile.lock | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gemfile.lock b/Gemfile.lock index 7c1427ca..9e5317b8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,6 +94,8 @@ GEM msgpack (~> 1.2) brakeman (7.0.0) racc + binding_of_caller (1.0.1) + debug_inspector (>= 1.2.0) builder (3.3.0) bullet (8.0.1) activesupport (>= 3.0.0) From 2389971315bb94a42b72602b7c9f8b61037f2bae Mon Sep 17 00:00:00 2001 From: lodewiges <131907615+lodewiges@users.noreply.github.com> Date: Wed, 19 Mar 2025 20:34:25 +0100 Subject: [PATCH 20/39] Update Gemfile.lock --- Gemfile.lock | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9e5317b8..67719c44 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -88,14 +88,12 @@ GEM rack (>= 0.9.0) bigdecimal (3.1.9) bigdecimal (3.1.9-java) - binding_of_caller (1.0.0) - debug_inspector (>= 0.0.1) + binding_of_caller (1.0.1) + debug_inspector (>= 1.2.0) bootsnap (1.18.4) msgpack (~> 1.2) brakeman (7.0.0) racc - binding_of_caller (1.0.1) - debug_inspector (>= 1.2.0) builder (3.3.0) bullet (8.0.1) activesupport (>= 3.0.0) From b38be0aea7394bc6223c0f9f0159881d6c6bcc91 Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Thu, 20 Mar 2025 01:30:11 +0100 Subject: [PATCH 21/39] Revert "made some changes to tests" This reverts commit f66db19c74503af960d5f5b8e4f9a0698bee11f5. --- app/models/debit/mandate.rb | 5 ++--- app/models/membership.rb | 15 +++++++-------- spec/requests/v1/books_controller/update_spec.rb | 2 +- .../v1/forum/posts_controller/update_spec.rb | 2 +- spec/requests/v1/groups_controller/update_spec.rb | 2 +- .../v1/room_adverts_controller/update_spec.rb | 2 +- .../v1/static_pages_controller/update_spec.rb | 2 +- spec/requests/v1/users_controller/update_spec.rb | 2 +- .../v1/vacancies_controller/update_spec.rb | 2 +- .../requests/creatable_and_permissible_model.rb | 6 +++--- 10 files changed, 19 insertions(+), 21 deletions(-) diff --git a/app/models/debit/mandate.rb b/app/models/debit/mandate.rb index f35545fc..5eb604ea 100644 --- a/app/models/debit/mandate.rb +++ b/app/models/debit/mandate.rb @@ -24,15 +24,14 @@ def unique_on_time_interval? # rubocop:disable Metrics/MethodLength return true unless Debit::Mandate.where.not(id:) .where(user_id:) .exists?([<<-SQL.squish, { start_date: start_date, end_date: end_date }]) - CAST(:start_date AS date) BETWEEN start_date AND end_date OR CAST(:end_date AS date) BETWEEN start_date AND end_date OR start_date BETWEEN CAST(:start_date AS date) AND CAST(:end_date AS date) OR end_date BETWEEN CAST(:start_date AS date) AND CAST(:end_date AS date) OR (start_date < CAST(:start_date AS date) AND end_date IS NULL) OR (start_date > CAST(:start_date AS date) AND CAST(:end_date AS date) IS NULL) - SQL - + SQL + errors.add(:mandate, 'is not unique on time interval') false end diff --git a/app/models/membership.rb b/app/models/membership.rb index a36587c5..4a30508d 100644 --- a/app/models/membership.rb +++ b/app/models/membership.rb @@ -20,21 +20,20 @@ class Membership < ApplicationRecord private def unique_on_time_interval? # rubocop:disable Metrics/MethodLength - return true unless Membership.where.not(id: id) - .where(group_id:, user_id:) - .exists?([<<-SQL.squish, { start_date: start_date, end_date: end_date }]) - + return true unless Membership.where.not(id:) + .where(group_id:, user_id:) + .exists?([<<-SQL.squish, { start_date: start_date, end_date: end_date }]) CAST(:start_date AS date) BETWEEN start_date AND end_date OR CAST(:end_date AS date) BETWEEN start_date AND end_date OR start_date BETWEEN CAST(:start_date AS date) AND CAST(:end_date AS date) OR end_date BETWEEN CAST(:start_date AS date) AND CAST(:end_date AS date) OR (start_date < CAST(:start_date AS date) AND end_date IS NULL) OR (start_date > CAST(:start_date AS date) AND CAST(:end_date AS date) IS NULL) - SQL + SQL - errors.add(:membership, 'is not unique on time interval') - false - end + errors.add(:membership, 'is not unique on time interval') + false +end # Remark, this will cause multiple updates when adding multiple users after each other # But this is quite hard to fix, but just be carefull diff --git a/spec/requests/v1/books_controller/update_spec.rb b/spec/requests/v1/books_controller/update_spec.rb index 56906701..545a5ea7 100644 --- a/spec/requests/v1/books_controller/update_spec.rb +++ b/spec/requests/v1/books_controller/update_spec.rb @@ -6,7 +6,7 @@ let(:record_url) { "/v1/books/#{record.id}" } let(:record_permission) { 'book.update' } - it_behaves_like 'an updatable and permissible model' do + it_behaves_like 'an updatable and permissible model', response: :ok do let(:invalid_attributes) { { title: '' } } end end diff --git a/spec/requests/v1/forum/posts_controller/update_spec.rb b/spec/requests/v1/forum/posts_controller/update_spec.rb index d5b93a32..79103bad 100644 --- a/spec/requests/v1/forum/posts_controller/update_spec.rb +++ b/spec/requests/v1/forum/posts_controller/update_spec.rb @@ -6,7 +6,7 @@ let(:record_url) { "/v1/forum/posts/#{record.id}" } let(:record_permission) { 'forum/post.update' } - it_behaves_like 'an updatable and permissible model' do + it_behaves_like 'an updatable and permissible model', response: :ok do let(:invalid_attributes) { { message: '' } } end diff --git a/spec/requests/v1/groups_controller/update_spec.rb b/spec/requests/v1/groups_controller/update_spec.rb index e8479287..6e7eb8fe 100644 --- a/spec/requests/v1/groups_controller/update_spec.rb +++ b/spec/requests/v1/groups_controller/update_spec.rb @@ -8,7 +8,7 @@ subject(:request) { put(record_url) } - it_behaves_like 'an updatable and permissible model' do + it_behaves_like 'an updatable and permissible model', response: :ok do let(:invalid_attributes) { { name: '' } } end diff --git a/spec/requests/v1/room_adverts_controller/update_spec.rb b/spec/requests/v1/room_adverts_controller/update_spec.rb index d6f980cf..1a590632 100644 --- a/spec/requests/v1/room_adverts_controller/update_spec.rb +++ b/spec/requests/v1/room_adverts_controller/update_spec.rb @@ -6,7 +6,7 @@ let(:record_url) { "/v1/room_adverts/#{record.id}" } let(:record_permission) { 'room_advert.update' } - it_behaves_like 'an updatable and permissible model' do + it_behaves_like 'an updatable and permissible model', response: :ok do let(:invalid_attributes) { { house_name: '' } } end diff --git a/spec/requests/v1/static_pages_controller/update_spec.rb b/spec/requests/v1/static_pages_controller/update_spec.rb index 09a9b4df..1f07837a 100644 --- a/spec/requests/v1/static_pages_controller/update_spec.rb +++ b/spec/requests/v1/static_pages_controller/update_spec.rb @@ -2,7 +2,7 @@ describe V1::StaticPagesController do describe 'PUT /static_pages/:slug', version: 1 do - it_behaves_like 'an updatable and permissible model' do + it_behaves_like 'an updatable and permissible model', response: :ok do let(:record) { create(:static_page) } let(:record_url) { "/v1/static_pages/#{record.id}" } let(:record_permission) { 'static_page.update' } diff --git a/spec/requests/v1/users_controller/update_spec.rb b/spec/requests/v1/users_controller/update_spec.rb index 8a5a7a80..5f0967c6 100644 --- a/spec/requests/v1/users_controller/update_spec.rb +++ b/spec/requests/v1/users_controller/update_spec.rb @@ -6,7 +6,7 @@ let(:record_url) { "/v1/users/#{record.id}" } let(:record_permission) { 'user.update' } - it_behaves_like 'an updatable and permissible model' do + it_behaves_like 'an updatable and permissible model', response: :ok do let(:invalid_attributes) { { email: '' } } end diff --git a/spec/requests/v1/vacancies_controller/update_spec.rb b/spec/requests/v1/vacancies_controller/update_spec.rb index 1d546beb..95ba2154 100644 --- a/spec/requests/v1/vacancies_controller/update_spec.rb +++ b/spec/requests/v1/vacancies_controller/update_spec.rb @@ -6,7 +6,7 @@ let(:record_url) { "/v1/vacancies/#{record.id}" } let(:record_permission) { 'vacancy.update' } - it_behaves_like 'an updatable and permissible model' do + it_behaves_like 'an updatable and permissible model', response: :ok do let(:invalid_attributes) { { title: '' } } end diff --git a/spec/support/behaviors/requests/creatable_and_permissible_model.rb b/spec/support/behaviors/requests/creatable_and_permissible_model.rb index d31ec27b..799152f9 100644 --- a/spec/support/behaviors/requests/creatable_and_permissible_model.rb +++ b/spec/support/behaviors/requests/creatable_and_permissible_model.rb @@ -1,4 +1,4 @@ -shared_examples 'a creatable and permissible model' do +shared_examples 'a creatable and permissible model' do |incorrect_data_response_behaves_like: '422 Unprocessable Entity'| # rubocop:disable Layout/LineLength let(:valid_attributes) { record.attributes } let(:valid_relationships) { {} } let(:invalid_attributes) { valid_attributes } @@ -48,7 +48,7 @@ context 'when using incorrect data' do subject(:request) { invalid_request } - it_behaves_like '422 Unprocessable Entity in Plain Text' + it_behaves_like incorrect_data_response_behaves_like it { expect { request }.not_to(change { record.class.count }) } end end @@ -64,7 +64,7 @@ context 'when using incorrect data' do subject(:request) { invalid_request } - it_behaves_like '422 Unprocessable Entity in Plain Text' + it_behaves_like incorrect_data_response_behaves_like it { expect { request }.not_to(change { record.class.count }) } end end From 8ee083428442c4fe5db63aeab5012b5cf5c2a00c Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Tue, 25 Mar 2025 01:05:33 +0100 Subject: [PATCH 22/39] fixed lint --- app/models/debit/mandate.rb | 5 +++-- app/models/membership.rb | 15 ++++++++------- .../v1/stored_mails_controller/index_spec.rb | 3 +++ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/app/models/debit/mandate.rb b/app/models/debit/mandate.rb index 5eb604ea..f35545fc 100644 --- a/app/models/debit/mandate.rb +++ b/app/models/debit/mandate.rb @@ -24,14 +24,15 @@ def unique_on_time_interval? # rubocop:disable Metrics/MethodLength return true unless Debit::Mandate.where.not(id:) .where(user_id:) .exists?([<<-SQL.squish, { start_date: start_date, end_date: end_date }]) + CAST(:start_date AS date) BETWEEN start_date AND end_date OR CAST(:end_date AS date) BETWEEN start_date AND end_date OR start_date BETWEEN CAST(:start_date AS date) AND CAST(:end_date AS date) OR end_date BETWEEN CAST(:start_date AS date) AND CAST(:end_date AS date) OR (start_date < CAST(:start_date AS date) AND end_date IS NULL) OR (start_date > CAST(:start_date AS date) AND CAST(:end_date AS date) IS NULL) - SQL - + SQL + errors.add(:mandate, 'is not unique on time interval') false end diff --git a/app/models/membership.rb b/app/models/membership.rb index 4a30508d..e700310a 100644 --- a/app/models/membership.rb +++ b/app/models/membership.rb @@ -20,20 +20,21 @@ class Membership < ApplicationRecord private def unique_on_time_interval? # rubocop:disable Metrics/MethodLength - return true unless Membership.where.not(id:) - .where(group_id:, user_id:) - .exists?([<<-SQL.squish, { start_date: start_date, end_date: end_date }]) + return true unless Membership.where.not(id:) + .where(group_id:, user_id:) + .exists?([<<-SQL.squish, { start_date: start_date, end_date: end_date }]) + CAST(:start_date AS date) BETWEEN start_date AND end_date OR CAST(:end_date AS date) BETWEEN start_date AND end_date OR start_date BETWEEN CAST(:start_date AS date) AND CAST(:end_date AS date) OR end_date BETWEEN CAST(:start_date AS date) AND CAST(:end_date AS date) OR (start_date < CAST(:start_date AS date) AND end_date IS NULL) OR (start_date > CAST(:start_date AS date) AND CAST(:end_date AS date) IS NULL) - SQL + SQL - errors.add(:membership, 'is not unique on time interval') - false -end + errors.add(:membership, 'is not unique on time interval') + false + end # Remark, this will cause multiple updates when adding multiple users after each other # But this is quite hard to fix, but just be carefull diff --git a/spec/requests/v1/stored_mails_controller/index_spec.rb b/spec/requests/v1/stored_mails_controller/index_spec.rb index 7c1edbc5..8574717a 100644 --- a/spec/requests/v1/stored_mails_controller/index_spec.rb +++ b/spec/requests/v1/stored_mails_controller/index_spec.rb @@ -22,8 +22,11 @@ before do create(:stored_mail) create_list(:stored_mail, 2, mail_alias:) + Bullet.enable = false end + after { Bullet.enable = true } + it_behaves_like '200 OK' it { expect(json['data'].count).to eq 2 } end From acdaf6efa0255e2c3e3c6a92948e5646504f8656 Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Tue, 25 Mar 2025 01:44:01 +0100 Subject: [PATCH 23/39] fixed tests --- app/models/import/user.rb | 1 + spec/requests/v1/stored_mails_controller/index_spec.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/app/models/import/user.rb b/app/models/import/user.rb index 4639cbe7..2a5d366f 100644 --- a/app/models/import/user.rb +++ b/app/models/import/user.rb @@ -1,6 +1,7 @@ module Import class User extend ActiveRecord::Translation + include ActiveModel::Model include SpreadsheetHelper attr_reader :errors, :imported_users diff --git a/spec/requests/v1/stored_mails_controller/index_spec.rb b/spec/requests/v1/stored_mails_controller/index_spec.rb index 8574717a..b9ed51ff 100644 --- a/spec/requests/v1/stored_mails_controller/index_spec.rb +++ b/spec/requests/v1/stored_mails_controller/index_spec.rb @@ -7,8 +7,12 @@ let(:records) { create_list(:stored_mail, 3) } let(:record_permission) { 'stored_mail.read' } + before { Bullet.enable = false } + it_behaves_like 'an indexable model' + after { Bullet.enable = true } + describe 'when user is moderator' do include_context 'when authenticated' do let(:user) { create(:user) } From 5e0d692f30e94695765349c6c8568bfabcf1250a Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Tue, 25 Mar 2025 02:09:27 +0100 Subject: [PATCH 24/39] fixed lint --- spec/requests/v1/stored_mails_controller/index_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/requests/v1/stored_mails_controller/index_spec.rb b/spec/requests/v1/stored_mails_controller/index_spec.rb index b9ed51ff..83ed54c5 100644 --- a/spec/requests/v1/stored_mails_controller/index_spec.rb +++ b/spec/requests/v1/stored_mails_controller/index_spec.rb @@ -8,11 +8,11 @@ let(:record_permission) { 'stored_mail.read' } before { Bullet.enable = false } - - it_behaves_like 'an indexable model' after { Bullet.enable = true } + it_behaves_like 'an indexable model' + describe 'when user is moderator' do include_context 'when authenticated' do let(:user) { create(:user) } From abc5e6441dab74dbd0e60b2e7c25312d6f835c03 Mon Sep 17 00:00:00 2001 From: lodewiges <131907615+lodewiges@users.noreply.github.com> Date: Tue, 25 Mar 2025 12:02:18 +0100 Subject: [PATCH 25/39] update rails config to 7.2 --- config/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index 0077f722..2c4bb2a3 100644 --- a/config/application.rb +++ b/config/application.rb @@ -16,7 +16,7 @@ module Amber class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.1 + config.load_defaults 7.2 config.add_autoload_paths_to_load_path = false # Please, add to the `ignore` list any other `lib` subdirectories that do From f1787983a176f1835a72600d91df98fbd7334dab Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Tue, 25 Mar 2025 13:02:07 +0100 Subject: [PATCH 26/39] ran rails update --- bin/brakeman | 7 + bin/rubocop | 8 + bin/setup | 4 + config/application.rb | 11 +- config/environments/development.rb | 23 +- config/environments/production.rb | 20 +- config/environments/test.rb | 35 ++- .../initializers/filter_parameter_logging.rb | 4 +- .../new_framework_defaults_7_1.rb | 256 ------------------ .../new_framework_defaults_7_2.rb | 70 +++++ config/puma.rb | 64 ++--- 11 files changed, 173 insertions(+), 329 deletions(-) create mode 100644 bin/brakeman create mode 100644 bin/rubocop delete mode 100644 config/initializers/new_framework_defaults_7_1.rb create mode 100644 config/initializers/new_framework_defaults_7_2.rb diff --git a/bin/brakeman b/bin/brakeman new file mode 100644 index 00000000..ace1c9ba --- /dev/null +++ b/bin/brakeman @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby +require "rubygems" +require "bundler/setup" + +ARGV.unshift("--ensure-latest") + +load Gem.bin_path("brakeman", "brakeman") diff --git a/bin/rubocop b/bin/rubocop new file mode 100644 index 00000000..40330c0f --- /dev/null +++ b/bin/rubocop @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby +require "rubygems" +require "bundler/setup" + +# explicit rubocop config increases performance slightly while avoiding config confusion. +ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__)) + +load Gem.bin_path("rubocop", "rubocop") diff --git a/bin/setup b/bin/setup index 451efe2e..fdf87f95 100755 --- a/bin/setup +++ b/bin/setup @@ -30,4 +30,8 @@ FileUtils.chdir APP_ROOT do puts "\n== Restarting application server ==" system! 'bin/rails restart' + + # puts "\n== Configuring puma-dev ==" + # system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}" + # system "curl -Is https://#{APP_NAME}.test/up | head -n 1" end diff --git a/config/application.rb b/config/application.rb index 0077f722..660a1603 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,4 +1,5 @@ require_relative 'boot' +# Pick the frameworks you want: require 'rails' require 'active_model/railtie' require 'active_job/railtie' @@ -7,7 +8,10 @@ require 'action_controller/railtie' require 'action_mailer/railtie' require 'action_mailbox/engine' -# require "action_view/railtie" +# require 'action_text/engine' +# require 'action_view/railtie' +# require 'action_cable/engine' +# require 'rails/test_unit/railtie' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. @@ -18,7 +22,6 @@ class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. config.load_defaults 7.1 - config.add_autoload_paths_to_load_path = false # Please, add to the `ignore` list any other `lib` subdirectories that do # not contain `.rb` files, or that should not be reloaded or eager loaded. # Common ones are `templates`, `generators`, or `middleware`, for example. @@ -38,10 +41,6 @@ class Application < Rails::Application config.api_only = true config.i18n.default_locale = :nl - # Required by message_bus as long as https://github.com/SamSaffron/message_bus/issues/124 - # is not fixed - config.middleware.use ActionDispatch::Flash - # See https://guides.rubyonrails.org/api_app.html#using-session-middlewares config.session_store :cookie_store, key: '_interslice_session' config.middleware.use ActionDispatch::Cookies diff --git a/config/environments/development.rb b/config/environments/development.rb index ac8c6c66..c84a1388 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -14,16 +14,14 @@ # Show full error reports. config.consider_all_requests_local = true - # Enable server timing + # Enable server timing. config.server_timing = true # Enable/disable caching. By default caching is disabled. # Run rails dev:cache to toggle caching. if Rails.root.join('tmp', 'caching-dev.txt').exist? config.cache_store = :memory_store - config.public_file_server.headers = { - 'Cache-Control' => "public, max-age=#{2.days.to_i}" - } + config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" } else config.action_controller.perform_caching = false @@ -36,8 +34,13 @@ # Don't care if the mailer can't send. config.action_mailer.raise_delivery_errors = false + # Disable caching for Action Mailer templates even if Action Controller + # caching is enabled. config.action_mailer.perform_caching = false + # Refer the Ember/UI of the Alpha website + config.action_mailer.default_url_options = { scheme: 'http', host: 'localhost', port: 4200 } + # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log @@ -60,10 +63,13 @@ # config.i18n.raise_on_missing_translations = true # Annotate rendered view with file names. - # config.action_view.annotate_rendered_view_with_filenames = true + config.action_view.annotate_rendered_view_with_filenames = true + + # Raise error when a before_action's only/except options reference missing actions. + config.action_controller.raise_on_missing_callback_actions = true - # Raise error when a before_action's only/except options reference missing actions - config.action_controller.raise_on_missing_callback_actions = false + # Apply autocorrection by RuboCop to files generated by `bin/rails generate`. + # config.generators.apply_rubocop_autocorrect_after_generate! # Use an evented file watcher to asynchronously detect changes in source code, # routes, locales, etc. This feature depends on the listen gem. @@ -74,9 +80,6 @@ config.action_mailer.smtp_settings = { address: 'localhost', port: 1025 } config.action_mailer.asset_host = 'http://localhost:4200/api' - # Refer the Ember/UI of the Alpha website - config.action_mailer.default_url_options = { scheme: 'http', host: 'localhost', port: 4200 } - # Allow access to the api via ngrok config.hosts << ENV['NGROK_HOST'] if ENV['NGROK_HOST'] diff --git a/config/environments/production.rb b/config/environments/production.rb index 7e0baa70..c190c415 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,3 +1,5 @@ +require 'active_support/core_ext/integer/time' + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. @@ -12,7 +14,6 @@ # Full error reports are disabled and caching is turned on. config.consider_all_requests_local = false - config.action_controller.perform_caching = true # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files). @@ -39,19 +40,21 @@ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. config.force_ssl = true + # Skip http-to-https redirect for the default health check endpoint. + # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } } + # Log to STDOUT by default config.logger = ActiveSupport::Logger.new($stdout) .tap { |logger| logger.formatter = Logger::Formatter.new } .then { |logger| ActiveSupport::TaggedLogging.new(logger) } - config.log_level = :debug # Prepend all log lines with the following tags. - config.log_tags = [:request_id] + config.log_tags = [ :request_id ] # "info" includes generic and useful information about system operation, but avoids logging too much # information to avoid inadvertent exposure of personally identifiable information (PII). If you # want to log everything, set the level to "debug". - config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'info') + config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'debug') # Use a different cache store in production. # config.cache_store = :mem_cache_store @@ -60,6 +63,8 @@ config.active_job.queue_adapter = :sidekiq # config.active_job.queue_name_prefix = "amber_production" + # Disable caching for Action Mailer templates even if Action Controller + # caching is enabled. config.action_mailer.perform_caching = false # Ignore bad email addresses and do not raise email delivery errors. @@ -70,12 +75,15 @@ # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true - # Send deprecation notices to registered listeners. - config.active_support.report_deprecations = :notify + # Don't log any deprecations. + config.active_support.report_deprecations = false # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false + # Only use :id for inspections in production. + config.active_record.attributes_for_inspect = [ :id ] + # Enable DNS rebinding protection and other `Host` header attacks. # config.hosts = [ # "example.com", # Allow requests from example.com diff --git a/config/environments/test.rb b/config/environments/test.rb index 4d012f33..c9e3a09e 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,3 +1,5 @@ +require 'active_support/core_ext/integer/time' + # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped @@ -6,26 +8,25 @@ Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - config.cache_classes = false + # While tests run files are not watched, reloading is not necessary. + config.enable_reloading = false - # Do not eager load code on boot. This avoids loading your whole application - # just for the purpose of running a single test. If you are using a tool that - # preloads Rails for running tests, you may have to set it to true. + # Eager loading loads your entire application. When running a single test locally, + # this is usually not necessary, and can slow down your test suite. However, it's + # recommended that you enable it in continuous integration systems to ensure eager + # loading is working properly before deploying your code. config.eager_load = false # Configure public file server for tests with Cache-Control for performance. - config.public_file_server.enabled = true - config.public_file_server.headers = { - 'Cache-Control' => "public, max-age=#{1.hour.to_i}" - } + config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{1.hour.to_i}" } # Show full error reports and disable caching. config.consider_all_requests_local = true config.action_controller.perform_caching = false config.cache_store = :null_store - # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = :none + # Render exception templates for rescuable exceptions and raise for other exceptions. + config.action_dispatch.show_exceptions = :rescuable # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false @@ -33,6 +34,8 @@ # Store uploaded files on the local file system in a temporary directory. config.active_storage.service = :test + # Disable caching for Action Mailer templates even if Action Controller + # caching is enabled. config.action_mailer.perform_caching = false # Tell Action Mailer not to deliver emails to the real world. @@ -40,6 +43,10 @@ # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test + # Unlike controllers, the mailer instance doesn't have any context about the + # incoming request so you'll need to provide the :host parameter yourself. + config.action_mailer.default_url_options = { scheme: 'http', host: 'testhost', port: 1337 } + # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr @@ -50,17 +57,15 @@ config.active_support.disallowed_deprecation_warnings = [] # Raises error for missing translations. - # config.action_view.raise_on_missing_translations = true + # config.i18n.raise_on_missing_translations = true # Annotate rendered view with file names. # config.action_view.annotate_rendered_view_with_filenames = true - # Raise error when a before_action's only/except options reference missing actions - config.action_controller.raise_on_missing_callback_actions = false + # Raise error when a before_action's only/except options reference missing actions. + config.action_controller.raise_on_missing_callback_actions = true # Configure url to test actionmailer urls - config.action_mailer.default_url_options = { scheme: 'http', host: 'testhost', port: 1337 } - config.active_job.queue_adapter = :test config.middleware.delete Rack::Attack config.x.mail_domains = %w[test.csvalpha.nl] diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index 7816b223..f025d8d5 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -3,6 +3,6 @@ # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. # Use this to limit dissemination of sensitive information. # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. -Rails.application.config.filter_parameters += %i[ - passw password secret token _key crypt salt certificate otp ssn +Rails.application.config.filter_parameters += [ + :passw, :password, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn ] diff --git a/config/initializers/new_framework_defaults_7_1.rb b/config/initializers/new_framework_defaults_7_1.rb deleted file mode 100644 index c0158740..00000000 --- a/config/initializers/new_framework_defaults_7_1.rb +++ /dev/null @@ -1,256 +0,0 @@ -# Be sure to restart your server when you modify this file. -# -# This file eases your Rails 7.1 framework defaults upgrade. -# -# Uncomment each configuration one by one to switch to the new default. -# Once your application is ready to run with all new defaults, you can remove -# this file and set the `config.load_defaults` to `7.1`. -# -# Read the Guide for Upgrading Ruby on Rails for more info on each option. -# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html - -### -# No longer add autoloaded paths into `$LOAD_PATH`. This means that you won't be able -# to manually require files that are managed by the autoloader, which you shouldn't do anyway. -# -# This will reduce the size of the load path, making `require` faster if you don't use bootsnap, or reduce the size -# of the bootsnap cache if you use it. -# -# To set this configuration, add the following line to `config/application.rb` (NOT this file): -# config.add_autoload_paths_to_load_path = false - -### -# Remove the default X-Download-Options headers since it is used only by Internet Explorer. -# If you need to support Internet Explorer, add back `"X-Download-Options" => "noopen"`. -#++ -Rails.application.config.action_dispatch.default_headers = { - 'X-Frame-Options' => 'SAMEORIGIN', - 'X-XSS-Protection' => '0', - 'X-Content-Type-Options' => 'nosniff', - 'X-Permitted-Cross-Domain-Policies' => 'none', - 'Referrer-Policy' => 'strict-origin-when-cross-origin' -} - -### -# Do not treat an `ActionController::Parameters` instance -# as equal to an equivalent `Hash` by default. -#++ -Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality = false - -### -# Active Record Encryption now uses SHA-256 as its hash digest algorithm. -# -# There are 3 scenarios to consider. -# -# 1. If you have data encrypted with previous Rails versions, and you have -# +config.active_support.key_generator_hash_digest_class+ configured as SHA1 (the default -# before Rails 7.0), you need to configure SHA-1 for Active Record Encryption too: -#++ -# Rails.application.config.active_record.encryption.hash_digest_class = OpenSSL::Digest::SHA1 -# -# 2. If you have +config.active_support.key_generator_hash_digest_class+ configured as SHA256 (the new default -# in 7.0), then you need to configure SHA-256 for Active Record Encryption: -#++ -# Rails.application.config.active_record.encryption.hash_digest_class = OpenSSL::Digest::SHA256 -# -# 3. If you don't currently have data encrypted with Active Record encryption, you can disable this setting to -# configure the default behavior starting 7.1+: -#++ -Rails.application.config.active_record.encryption.support_sha1_for_non_deterministic_encryption = false - -### -# No longer run after_commit callbacks on the first of multiple Active Record -# instances to save changes to the same database row within a transaction. -# Instead, run these callbacks on the instance most likely to have internal -# state which matches what was committed to the database, typically the last -# instance to save. -#++ -Rails.application.config.active_record.run_commit_callbacks_on_first_saved_instances_in_transaction = false - -### -# Configures SQLite with a strict strings mode, which disables double-quoted string literals. -# -# SQLite has some quirks around double-quoted string literals. -# It first tries to consider double-quoted strings as identifier names, but if they don't exist -# it then considers them as string literals. Because of this, typos can silently go unnoticed. -# For example, it is possible to create an index for a non existing column. -# See https://www.sqlite.org/quirks.html#double_quoted_string_literals_are_accepted for more details. -#++ -Rails.application.config.active_record.sqlite3_adapter_strict_strings_by_default = true - -### -# Disable deprecated singular associations names. -#++ -Rails.application.config.active_record.allow_deprecated_singular_associations_name = false - -### -# Enable the Active Job `BigDecimal` argument serializer, which guarantees -# roundtripping. Without this serializer, some queue adapters may serialize -# `BigDecimal` arguments as simple (non-roundtrippable) strings. -# -# When deploying an application with multiple replicas, old (pre-Rails 7.1) -# replicas will not be able to deserialize `BigDecimal` arguments from this -# serializer. Therefore, this setting should only be enabled after all replicas -# have been successfully upgraded to Rails 7.1. -#++ -Rails.application.config.active_job.use_big_decimal_serializer = true - -### -# Specify if an `ArgumentError` should be raised if `Rails.cache` `fetch` or -# `write` are given an invalid `expires_at` or `expires_in` time. -# Options are `true`, and `false`. If `false`, the exception will be reported -# as `handled` and logged instead. -#++ -Rails.application.config.active_support.raise_on_invalid_cache_expiration_time = true - -### -# Specify whether Query Logs will format tags using the SQLCommenter format -# (https://open-telemetry.github.io/opentelemetry-sqlcommenter/), or using the legacy format. -# Options are `:legacy` and `:sqlcommenter`. -#++ -Rails.application.config.active_record.query_log_tags_format = :sqlcommenter - -### -# Specify the default serializer used by `MessageEncryptor` and `MessageVerifier` -# instances. -# -# The legacy default is `:marshal`, which is a potential vector for -# deserialization attacks in cases where a message signing secret has been -# leaked. -# -# In Rails 7.1, the new default is `:json_allow_marshal` which serializes and -# deserializes with `ActiveSupport::JSON`, but can fall back to deserializing -# with `Marshal` so that legacy messages can still be read. -# -# In Rails 7.2, the default will become `:json` which serializes and -# deserializes with `ActiveSupport::JSON` only. -# -# Alternatively, you can choose `:message_pack` or `:message_pack_allow_marshal`, -# which serialize with `ActiveSupport::MessagePack`. `ActiveSupport::MessagePack` -# can roundtrip some Ruby types that are not supported by JSON, and may provide -# improved performance, but it requires the `msgpack` gem. -# -# For more information, see -# https://guides.rubyonrails.org/v7.1/configuring.html#config-active-support-message-serializer -# -# If you are performing a rolling deploy of a Rails 7.1 upgrade, wherein servers -# that have not yet been upgraded must be able to read messages from upgraded -# servers, first deploy without changing the serializer, then set the serializer -# in a subsequent deploy. -#++ -Rails.application.config.active_support.message_serializer = :json_allow_marshal - -### -# Enable a performance optimization that serializes message data and metadata -# together. This changes the message format, so messages serialized this way -# cannot be read by older versions of Rails. However, messages that use the old -# format can still be read, regardless of whether this optimization is enabled. -# -# To perform a rolling deploy of a Rails 7.1 upgrade, wherein servers that have -# not yet been upgraded must be able to read messages from upgraded servers, -# leave this optimization off on the first deploy, then enable it on a -# subsequent deploy. -#++ -Rails.application.config.active_support.use_message_serializer_for_metadata = true - -### -# Set the maximum size for Rails log files. -# -# `config.load_defaults 7.1` does not set this value for environments other than -# development and test. -#++ -Rails.application.config.log_file_size = 100 * 1024 * 1024 if Rails.env.local? - -### -# Enable raising on assignment to attr_readonly attributes. The previous -# behavior would allow assignment but silently not persist changes to the -# database. -#++ -Rails.application.config.active_record.raise_on_assign_to_attr_readonly = true - -### -# Enable validating only parent-related columns for presence when the parent is mandatory. -# The previous behavior was to validate the presence of the parent record, which performed an extra query -# to get the parent every time the child record was updated, even when parent has not changed. -#++ -Rails.application.config.active_record.belongs_to_required_validates_foreign_key = false - -### -# Enable precompilation of `config.filter_parameters`. Precompilation can -# improve filtering performance, depending on the quantity and types of filters. -#++ -Rails.application.config.precompile_filter_parameters = true - -### -# Enable before_committed! callbacks on all enrolled records in a transaction. -# The previous behavior was to only run the callbacks on the first copy of a record -# if there were multiple copies of the same record enrolled in the transaction. -#++ -Rails.application.config.active_record.before_committed_on_all_records = true - -### -# Disable automatic column serialization into YAML. -# To keep the historic behavior, you can set it to `YAML`, however it is -# recommended to explicitly define the serialization method for each column -# rather than to rely on a global default. -#++ -Rails.application.config.active_record.default_column_serializer = nil - -### -# Enable a performance optimization that serializes Active Record models -# in a faster and more compact way. -# -# To perform a rolling deploy of a Rails 7.1 upgrade, wherein servers that have -# not yet been upgraded must be able to read caches from upgraded servers, -# leave this optimization off on the first deploy, then enable it on a -# subsequent deploy. -#++ -# Rails.application.config.active_record.marshalling_format_version = 7.1 - -### -# Run `after_commit` and `after_*_commit` callbacks in the order they are defined in a model. -# This matches the behaviour of all other callbacks. -# In previous versions of Rails, they ran in the inverse order. -#++ -Rails.application.config.active_record.run_after_transaction_callbacks_in_order_defined = true - -### -# Whether a `transaction` block is committed or rolled back when exited via `return`, `break` or `throw`. -#++ -Rails.application.config.active_record.commit_transaction_on_non_local_return = true - -### -# Controls when to generate a value for has_secure_token declarations. -#++ -Rails.application.config.active_record.generate_secure_token_on = :initialize - -### -# ** Please read carefully, this must be configured in config/application.rb ** -# -# Change the format of the cache entry. -# -# Changing this default means that all new cache entries added to the cache -# will have a different format that is not supported by Rails 7.0 -# applications. -# -# Only change this value after your application is fully deployed to Rails 7.1 -# and you have no plans to rollback. -# When you're ready to change format, add this to `config/application.rb` (NOT -# this file): -# config.active_support.cache_format_version = 7.1 - -### -# Configure the log level used by the DebugExceptions middleware when logging -# uncaught exceptions during requests. -#++ -Rails.application.config.action_dispatch.debug_exception_log_level = :error - -### -# Configure the test helpers in Action View, Action Dispatch, and rails-dom-testing to use HTML5 -# parsers. -# -# Nokogiri::HTML5 isn't supported on JRuby, so JRuby applications must set this to :html4. -# -# In previous versions of Rails, these test helpers always used an HTML4 parser. -#++ -Rails.application.config.dom_testing_default_html_version = :html5 diff --git a/config/initializers/new_framework_defaults_7_2.rb b/config/initializers/new_framework_defaults_7_2.rb new file mode 100644 index 00000000..b549c4a2 --- /dev/null +++ b/config/initializers/new_framework_defaults_7_2.rb @@ -0,0 +1,70 @@ +# Be sure to restart your server when you modify this file. +# +# This file eases your Rails 7.2 framework defaults upgrade. +# +# Uncomment each configuration one by one to switch to the new default. +# Once your application is ready to run with all new defaults, you can remove +# this file and set the `config.load_defaults` to `7.2`. +# +# Read the Guide for Upgrading Ruby on Rails for more info on each option. +# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html + +### +# Controls whether Active Job's `#perform_later` and similar methods automatically defer +# the job queuing to after the current Active Record transaction is committed. +# +# Example: +# Topic.transaction do +# topic = Topic.create(...) +# NewTopicNotificationJob.perform_later(topic) +# end +# +# In this example, if the configuration is set to `:never`, the job will +# be enqueued immediately, even though the `Topic` hasn't been committed yet. +# Because of this, if the job is picked up almost immediately, or if the +# transaction doesn't succeed for some reason, the job will fail to find this +# topic in the database. +# +# If `enqueue_after_transaction_commit` is set to `:default`, the queue adapter +# will define the behaviour. +# +# Note: Active Job backends can disable this feature. This is generally done by +# backends that use the same database as Active Record as a queue, hence they +# don't need this feature. +#++ +# Rails.application.config.active_job.enqueue_after_transaction_commit = :default + +### +# Adds image/webp to the list of content types Active Storage considers as an image +# Prevents automatic conversion to a fallback PNG, and assumes clients support WebP, as they support gif, jpeg, and png. +# This is possible due to broad browser support for WebP, but older browsers and email clients may still not support +# WebP. Requires imagemagick/libvips built with WebP support. +#++ +# Rails.application.config.active_storage.web_image_content_types = %w[image/png image/jpeg image/gif image/webp] + +### +# Enable validation of migration timestamps. When set, an ActiveRecord::InvalidMigrationTimestampError +# will be raised if the timestamp prefix for a migration is more than a day ahead of the timestamp +# associated with the current time. This is done to prevent forward-dating of migration files, which can +# impact migration generation and other migration commands. +# +# Applications with existing timestamped migrations that do not adhere to the +# expected format can disable validation by setting this config to `false`. +#++ +# Rails.application.config.active_record.validate_migration_timestamps = true + +### +# Controls whether the PostgresqlAdapter should decode dates automatically with manual queries. +# +# Example: +# ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.select_value("select '2024-01-01'::date") #=> Date +# +# This query used to return a `String`. +#++ +# Rails.application.config.active_record.postgresql_adapter_decode_dates = true + +### +# Enables YJIT as of Ruby 3.3, to bring sizeable performance improvements. If you are +# deploying to a memory constrained environment you may want to set this to `false`. +#++ +# Rails.application.config.yjit = true diff --git a/config/puma.rb b/config/puma.rb index db29bd98..3c275cd1 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,41 +1,37 @@ -# Puma can serve each request in a thread from an internal thread pool. -# The `threads` method setting takes two numbers: a minimum and maximum. -# Any libraries that use thread pools should be configured to match -# the maximum value specified for Puma. Default is set to 5 threads for minimum -# and maximum; this matches the default thread size of Active Record. -# -max_threads_count = ENV.fetch('RAILS_MAX_THREADS', 5) -min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count } -threads min_threads_count, max_threads_count +# This configuration file will be evaluated by Puma. The top-level methods that +# are invoked here are part of Puma's configuration DSL. For more information +# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. -# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +# Puma starts a configurable number of processes (workers) and each process +# serves each request in a thread from an internal thread pool. # -port ENV.fetch('PORT', 3000) - -# Specifies the `environment` that Puma will run in. +# The ideal number of threads per worker depends both on how much time the +# application spends waiting for IO operations and on how much you wish to +# to prioritize throughput over latency. # -environment ENV.fetch('RAILS_ENV') { 'development' } - -# Specifies the `pidfile` that Puma will use. -pidfile = ENV.fetch('PIDFILE') { 'tmp/pids/server.pid' } - -# Ensure that the pidfile path exists -Pathname(pidfile).dirname.mkpath - -# Specifies the number of `workers` to boot in clustered mode. -# Workers are forked web server processes. If using threads and workers together -# the concurrency of the application would be max `threads` * `workers`. -# Workers do not work on JRuby or Windows (both of which do not support -# processes). +# As a rule of thumb, increasing the number of threads will increase how much +# traffic a given process can handle (throughput), but due to CRuby's +# Global VM Lock (GVL) it has diminishing returns and will degrade the +# response time (latency) of the application. # -# workers ENV.fetch("WEB_CONCURRENCY") { 2 } - -# Use the `preload_app!` method when specifying a `workers` number. -# This directive tells Puma to first boot the application and load code -# before forking the application. This takes advantage of Copy On Write -# process behavior so workers use less memory. +# The default is set to 3 threads as it's deemed a decent compromise between +# throughput and latency for the average Rails application. # -# preload_app! +# Any libraries that use a connection pool or another resource pool should +# be configured to provide at least as many connections as the number of +# threads. This includes Active Record's `pool` parameter in `database.yml`. +threads_count = ENV.fetch('RAILS_MAX_THREADS', 5) +threads threads_count, threads_count + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +port ENV.fetch("PORT", 3000) -# Allow puma to be restarted by `rails restart` command. +# Allow puma to be restarted by `bin/rails restart` command. plugin :tmp_restart + +# Specify the PID file. Defaults to tmp/pids/server.pid in development. +# In other environments, only set the PID file if requested. +pidfile ENV["PIDFILE"] if ENV["PIDFILE"] + +# Specifies the `environment` that Puma will run in. +environment ENV.fetch('RAILS_ENV') { 'development' } From a6caf57d50c2b074c03375718a18e21e8f0d0e49 Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Tue, 25 Mar 2025 13:14:02 +0100 Subject: [PATCH 27/39] fix lint --- bin/brakeman | 8 ++++---- bin/rubocop | 8 ++++---- config/application.rb | 4 +++- config/environments/development.rb | 2 +- config/environments/production.rb | 4 ++-- config/environments/test.rb | 2 +- config/initializers/filter_parameter_logging.rb | 4 ++-- config/puma.rb | 4 ++-- 8 files changed, 19 insertions(+), 17 deletions(-) diff --git a/bin/brakeman b/bin/brakeman index ace1c9ba..9c405df7 100644 --- a/bin/brakeman +++ b/bin/brakeman @@ -1,7 +1,7 @@ #!/usr/bin/env ruby -require "rubygems" -require "bundler/setup" +require 'rubygems' +require 'bundler/setup' -ARGV.unshift("--ensure-latest") +ARGV.unshift('--ensure-latest') -load Gem.bin_path("brakeman", "brakeman") +load Gem.bin_path('brakeman', 'brakeman') diff --git a/bin/rubocop b/bin/rubocop index 40330c0f..b3ed7c5e 100644 --- a/bin/rubocop +++ b/bin/rubocop @@ -1,8 +1,8 @@ #!/usr/bin/env ruby -require "rubygems" -require "bundler/setup" +require 'rubygems' +require 'bundler/setup' # explicit rubocop config increases performance slightly while avoiding config confusion. -ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__)) +ARGV.unshift('--config', File.expand_path('../.rubocop.yml', __dir__)) -load Gem.bin_path("rubocop", "rubocop") +load Gem.bin_path('rubocop', 'rubocop') diff --git a/config/application.rb b/config/application.rb index 1534e6d3..cbe5f3cf 100644 --- a/config/application.rb +++ b/config/application.rb @@ -20,7 +20,7 @@ module Amber class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.2 + config.load_defaults 7.1 # Please, add to the `ignore` list any other `lib` subdirectories that do # not contain `.rb` files, or that should not be reloaded or eager loaded. @@ -59,6 +59,8 @@ class Application < Rails::Application end end + config.action_controller.raise_on_missing_callback_actions = false + config.action_mailbox.ingress = :improvmx config.action_mailbox.incinerate_after = 7.days diff --git a/config/environments/development.rb b/config/environments/development.rb index c84a1388..6984d01b 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -21,7 +21,7 @@ # Run rails dev:cache to toggle caching. if Rails.root.join('tmp', 'caching-dev.txt').exist? config.cache_store = :memory_store - config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" } + config.public_file_server.headers = { 'Cache-Control' => "public, max-age=#{2.days.to_i}" } else config.action_controller.perform_caching = false diff --git a/config/environments/production.rb b/config/environments/production.rb index c190c415..3e3a74c7 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -49,7 +49,7 @@ .then { |logger| ActiveSupport::TaggedLogging.new(logger) } # Prepend all log lines with the following tags. - config.log_tags = [ :request_id ] + config.log_tags = [:request_id] # "info" includes generic and useful information about system operation, but avoids logging too much # information to avoid inadvertent exposure of personally identifiable information (PII). If you @@ -82,7 +82,7 @@ config.active_record.dump_schema_after_migration = false # Only use :id for inspections in production. - config.active_record.attributes_for_inspect = [ :id ] + config.active_record.attributes_for_inspect = [:id] # Enable DNS rebinding protection and other `Host` header attacks. # config.hosts = [ diff --git a/config/environments/test.rb b/config/environments/test.rb index c9e3a09e..e58d57cd 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -18,7 +18,7 @@ config.eager_load = false # Configure public file server for tests with Cache-Control for performance. - config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{1.hour.to_i}" } + config.public_file_server.headers = { 'Cache-Control' => "public, max-age=#{1.hour.to_i}" } # Show full error reports and disable caching. config.consider_all_requests_local = true diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index f025d8d5..7f9cf478 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -3,6 +3,6 @@ # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. # Use this to limit dissemination of sensitive information. # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. -Rails.application.config.filter_parameters += [ - :passw, :password, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn +Rails.application.config.filter_parameters += %i[ + passw password email secret token _key crypt salt certificate otp ssn ] diff --git a/config/puma.rb b/config/puma.rb index 3c275cd1..61566d04 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -24,14 +24,14 @@ threads threads_count, threads_count # Specifies the `port` that Puma will listen on to receive requests; default is 3000. -port ENV.fetch("PORT", 3000) +port ENV.fetch('PORT', 3000) # Allow puma to be restarted by `bin/rails restart` command. plugin :tmp_restart # Specify the PID file. Defaults to tmp/pids/server.pid in development. # In other environments, only set the PID file if requested. -pidfile ENV["PIDFILE"] if ENV["PIDFILE"] +pidfile ENV['PIDFILE'] if ENV['PIDFILE'] # Specifies the `environment` that Puma will run in. environment ENV.fetch('RAILS_ENV') { 'development' } From 001429c39083cbb6f23ffd16014e6de8fe9fd646 Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Tue, 25 Mar 2025 13:24:22 +0100 Subject: [PATCH 28/39] fix some tests --- config/application.rb | 2 -- config/environments/test.rb | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/config/application.rb b/config/application.rb index cbe5f3cf..660a1603 100644 --- a/config/application.rb +++ b/config/application.rb @@ -59,8 +59,6 @@ class Application < Rails::Application end end - config.action_controller.raise_on_missing_callback_actions = false - config.action_mailbox.ingress = :improvmx config.action_mailbox.incinerate_after = 7.days diff --git a/config/environments/test.rb b/config/environments/test.rb index e58d57cd..d1c5033c 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -63,7 +63,7 @@ # config.action_view.annotate_rendered_view_with_filenames = true # Raise error when a before_action's only/except options reference missing actions. - config.action_controller.raise_on_missing_callback_actions = true + config.action_controller.raise_on_missing_callback_actions = false # Configure url to test actionmailer urls config.middleware.delete Rack::Attack From ac63a3d0a2161f4ddb3a76dbca41fa6185eb4b0e Mon Sep 17 00:00:00 2001 From: lodewiges <131907615+lodewiges@users.noreply.github.com> Date: Tue, 25 Mar 2025 13:39:06 +0100 Subject: [PATCH 29/39] Update test.rb --- config/environments/test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/test.rb b/config/environments/test.rb index d1c5033c..5dc1bf4d 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -26,7 +26,7 @@ config.cache_store = :null_store # Render exception templates for rescuable exceptions and raise for other exceptions. - config.action_dispatch.show_exceptions = :rescuable + config.action_dispatch.show_exceptions = :none # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false From 90f5c91a350cf9f61611852e09112c8f870a4a1a Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Tue, 25 Mar 2025 16:49:05 +0100 Subject: [PATCH 30/39] update random stuff --- config/initializers/new_framework_defaults_7_2.rb | 2 +- docker-compose.development.yml | 2 -- docker-compose.yml | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/config/initializers/new_framework_defaults_7_2.rb b/config/initializers/new_framework_defaults_7_2.rb index b549c4a2..36e5e357 100644 --- a/config/initializers/new_framework_defaults_7_2.rb +++ b/config/initializers/new_framework_defaults_7_2.rb @@ -57,7 +57,7 @@ # Controls whether the PostgresqlAdapter should decode dates automatically with manual queries. # # Example: -# ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.select_value("select '2024-01-01'::date") #=> Date +# ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.select_value("select '2025-01-01'::date") #=> Date # # This query used to return a `String`. #++ diff --git a/docker-compose.development.yml b/docker-compose.development.yml index 09578e0f..c233739f 100644 --- a/docker-compose.development.yml +++ b/docker-compose.development.yml @@ -1,5 +1,3 @@ -version: '3' - services: db: image: postgres:14.7 diff --git a/docker-compose.yml b/docker-compose.yml index 8a9d8b7b..d38944dc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '2' - services: db: env_file: .env From 2c529e7983ef6552de6c0cc056a91462205cb517 Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Tue, 25 Mar 2025 16:52:08 +0100 Subject: [PATCH 31/39] change file permissions --- bin/brakeman | 0 bin/rubocop | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 bin/brakeman mode change 100644 => 100755 bin/rubocop diff --git a/bin/brakeman b/bin/brakeman old mode 100644 new mode 100755 diff --git a/bin/rubocop b/bin/rubocop old mode 100644 new mode 100755 From 8adacc94f722660f0e2ab162d69f97ad2411d2ab Mon Sep 17 00:00:00 2001 From: lodewiges <131907615+lodewiges@users.noreply.github.com> Date: Wed, 26 Mar 2025 23:12:18 +0100 Subject: [PATCH 32/39] try if rack works right now --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index df68dacf..923a83ac 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -331,7 +331,7 @@ GEM raabro (1.4.0) racc (1.8.1) racc (1.8.1-java) - rack (3.0.14) + rack (3.1.12) rack-attack (6.7.0) rack (>= 1.0, < 4) rack-cors (2.0.2) From 186cda21134fb8321d323f04fef0926dda15a054 Mon Sep 17 00:00:00 2001 From: lodewiges <131907615+lodewiges@users.noreply.github.com> Date: Fri, 28 Mar 2025 19:08:40 +0100 Subject: [PATCH 33/39] revert Update Gemfile.lock --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 923a83ac..df68dacf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -331,7 +331,7 @@ GEM raabro (1.4.0) racc (1.8.1) racc (1.8.1-java) - rack (3.1.12) + rack (3.0.14) rack-attack (6.7.0) rack (>= 1.0, < 4) rack-cors (2.0.2) From 35a8897580c918e9baed8bd163a56858611d0368 Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Fri, 28 Mar 2025 20:57:19 +0100 Subject: [PATCH 34/39] update aplication.rb --- .rubocop.yml | 2 +- config/application.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index c0b35e45..f58b2257 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,7 +6,7 @@ plugins: - rubocop-rspec_rails AllCops: - TargetRailsVersion: 7.1 + TargetRailsVersion: 8.0 TargetRubyVersion: 3.3 Exclude: - 'db/schema.rb' diff --git a/config/application.rb b/config/application.rb index c5ce7437..2c4bb2a3 100644 --- a/config/application.rb +++ b/config/application.rb @@ -16,7 +16,7 @@ module Amber class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.0 + config.load_defaults 7.2 config.add_autoload_paths_to_load_path = false # Please, add to the `ignore` list any other `lib` subdirectories that do From 9b7aceac700a10a55a702be12e9c38b8f02e4f58 Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Fri, 28 Mar 2025 21:05:01 +0100 Subject: [PATCH 35/39] change tes.rb --- config/environments/test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/environments/test.rb b/config/environments/test.rb index 5dc1bf4d..e58d57cd 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -26,7 +26,7 @@ config.cache_store = :null_store # Render exception templates for rescuable exceptions and raise for other exceptions. - config.action_dispatch.show_exceptions = :none + config.action_dispatch.show_exceptions = :rescuable # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false @@ -63,7 +63,7 @@ # config.action_view.annotate_rendered_view_with_filenames = true # Raise error when a before_action's only/except options reference missing actions. - config.action_controller.raise_on_missing_callback_actions = false + config.action_controller.raise_on_missing_callback_actions = true # Configure url to test actionmailer urls config.middleware.delete Rack::Attack From 7dc07b39bb8893a27058f27aca022f63f4797e0b Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Fri, 28 Mar 2025 21:12:20 +0100 Subject: [PATCH 36/39] change test.rb --- app/controllers/v1/activities_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/v1/activities_controller.rb b/app/controllers/v1/activities_controller.rb index d4dcdc44..f9551525 100644 --- a/app/controllers/v1/activities_controller.rb +++ b/app/controllers/v1/activities_controller.rb @@ -1,7 +1,7 @@ require 'icalendar/tzinfo' class V1::ActivitiesController < V1::ApplicationController - before_action :doorkeeper_authorize!, except: %i[index upcoming show ical] + before_action :doorkeeper_authorize!, except: %i[index show ical] before_action :set_model, only: %i[generate_alias] def generate_alias From 8d02788282c70df4f7522b1e69ab75c4b1947726 Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Fri, 28 Mar 2025 21:21:21 +0100 Subject: [PATCH 37/39] change tests --- config/environments/development.rb | 2 +- spec/requests/v1/users_controller/destroy_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index 6984d01b..41e3f479 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -69,7 +69,7 @@ config.action_controller.raise_on_missing_callback_actions = true # Apply autocorrection by RuboCop to files generated by `bin/rails generate`. - # config.generators.apply_rubocop_autocorrect_after_generate! + config.generators.apply_rubocop_autocorrect_after_generate! # Use an evented file watcher to asynchronously detect changes in source code, # routes, locales, etc. This feature depends on the listen gem. diff --git a/spec/requests/v1/users_controller/destroy_spec.rb b/spec/requests/v1/users_controller/destroy_spec.rb index 392d270b..6d814867 100644 --- a/spec/requests/v1/users_controller/destroy_spec.rb +++ b/spec/requests/v1/users_controller/destroy_spec.rb @@ -7,6 +7,6 @@ subject(:request) { delete(record_url) } - it { expect { request }.to raise_error(ActionController::RoutingError) } + it_behaves_like '404 Not Found' end end From c3682cb9f6645230fb8b41686641d78902f312a2 Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Fri, 28 Mar 2025 23:34:13 +0100 Subject: [PATCH 38/39] remove 7.1 defaults --- .../new_framework_defaults_7_1.rb | 256 ------------------ 1 file changed, 256 deletions(-) delete mode 100644 config/initializers/new_framework_defaults_7_1.rb diff --git a/config/initializers/new_framework_defaults_7_1.rb b/config/initializers/new_framework_defaults_7_1.rb deleted file mode 100644 index c0158740..00000000 --- a/config/initializers/new_framework_defaults_7_1.rb +++ /dev/null @@ -1,256 +0,0 @@ -# Be sure to restart your server when you modify this file. -# -# This file eases your Rails 7.1 framework defaults upgrade. -# -# Uncomment each configuration one by one to switch to the new default. -# Once your application is ready to run with all new defaults, you can remove -# this file and set the `config.load_defaults` to `7.1`. -# -# Read the Guide for Upgrading Ruby on Rails for more info on each option. -# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html - -### -# No longer add autoloaded paths into `$LOAD_PATH`. This means that you won't be able -# to manually require files that are managed by the autoloader, which you shouldn't do anyway. -# -# This will reduce the size of the load path, making `require` faster if you don't use bootsnap, or reduce the size -# of the bootsnap cache if you use it. -# -# To set this configuration, add the following line to `config/application.rb` (NOT this file): -# config.add_autoload_paths_to_load_path = false - -### -# Remove the default X-Download-Options headers since it is used only by Internet Explorer. -# If you need to support Internet Explorer, add back `"X-Download-Options" => "noopen"`. -#++ -Rails.application.config.action_dispatch.default_headers = { - 'X-Frame-Options' => 'SAMEORIGIN', - 'X-XSS-Protection' => '0', - 'X-Content-Type-Options' => 'nosniff', - 'X-Permitted-Cross-Domain-Policies' => 'none', - 'Referrer-Policy' => 'strict-origin-when-cross-origin' -} - -### -# Do not treat an `ActionController::Parameters` instance -# as equal to an equivalent `Hash` by default. -#++ -Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality = false - -### -# Active Record Encryption now uses SHA-256 as its hash digest algorithm. -# -# There are 3 scenarios to consider. -# -# 1. If you have data encrypted with previous Rails versions, and you have -# +config.active_support.key_generator_hash_digest_class+ configured as SHA1 (the default -# before Rails 7.0), you need to configure SHA-1 for Active Record Encryption too: -#++ -# Rails.application.config.active_record.encryption.hash_digest_class = OpenSSL::Digest::SHA1 -# -# 2. If you have +config.active_support.key_generator_hash_digest_class+ configured as SHA256 (the new default -# in 7.0), then you need to configure SHA-256 for Active Record Encryption: -#++ -# Rails.application.config.active_record.encryption.hash_digest_class = OpenSSL::Digest::SHA256 -# -# 3. If you don't currently have data encrypted with Active Record encryption, you can disable this setting to -# configure the default behavior starting 7.1+: -#++ -Rails.application.config.active_record.encryption.support_sha1_for_non_deterministic_encryption = false - -### -# No longer run after_commit callbacks on the first of multiple Active Record -# instances to save changes to the same database row within a transaction. -# Instead, run these callbacks on the instance most likely to have internal -# state which matches what was committed to the database, typically the last -# instance to save. -#++ -Rails.application.config.active_record.run_commit_callbacks_on_first_saved_instances_in_transaction = false - -### -# Configures SQLite with a strict strings mode, which disables double-quoted string literals. -# -# SQLite has some quirks around double-quoted string literals. -# It first tries to consider double-quoted strings as identifier names, but if they don't exist -# it then considers them as string literals. Because of this, typos can silently go unnoticed. -# For example, it is possible to create an index for a non existing column. -# See https://www.sqlite.org/quirks.html#double_quoted_string_literals_are_accepted for more details. -#++ -Rails.application.config.active_record.sqlite3_adapter_strict_strings_by_default = true - -### -# Disable deprecated singular associations names. -#++ -Rails.application.config.active_record.allow_deprecated_singular_associations_name = false - -### -# Enable the Active Job `BigDecimal` argument serializer, which guarantees -# roundtripping. Without this serializer, some queue adapters may serialize -# `BigDecimal` arguments as simple (non-roundtrippable) strings. -# -# When deploying an application with multiple replicas, old (pre-Rails 7.1) -# replicas will not be able to deserialize `BigDecimal` arguments from this -# serializer. Therefore, this setting should only be enabled after all replicas -# have been successfully upgraded to Rails 7.1. -#++ -Rails.application.config.active_job.use_big_decimal_serializer = true - -### -# Specify if an `ArgumentError` should be raised if `Rails.cache` `fetch` or -# `write` are given an invalid `expires_at` or `expires_in` time. -# Options are `true`, and `false`. If `false`, the exception will be reported -# as `handled` and logged instead. -#++ -Rails.application.config.active_support.raise_on_invalid_cache_expiration_time = true - -### -# Specify whether Query Logs will format tags using the SQLCommenter format -# (https://open-telemetry.github.io/opentelemetry-sqlcommenter/), or using the legacy format. -# Options are `:legacy` and `:sqlcommenter`. -#++ -Rails.application.config.active_record.query_log_tags_format = :sqlcommenter - -### -# Specify the default serializer used by `MessageEncryptor` and `MessageVerifier` -# instances. -# -# The legacy default is `:marshal`, which is a potential vector for -# deserialization attacks in cases where a message signing secret has been -# leaked. -# -# In Rails 7.1, the new default is `:json_allow_marshal` which serializes and -# deserializes with `ActiveSupport::JSON`, but can fall back to deserializing -# with `Marshal` so that legacy messages can still be read. -# -# In Rails 7.2, the default will become `:json` which serializes and -# deserializes with `ActiveSupport::JSON` only. -# -# Alternatively, you can choose `:message_pack` or `:message_pack_allow_marshal`, -# which serialize with `ActiveSupport::MessagePack`. `ActiveSupport::MessagePack` -# can roundtrip some Ruby types that are not supported by JSON, and may provide -# improved performance, but it requires the `msgpack` gem. -# -# For more information, see -# https://guides.rubyonrails.org/v7.1/configuring.html#config-active-support-message-serializer -# -# If you are performing a rolling deploy of a Rails 7.1 upgrade, wherein servers -# that have not yet been upgraded must be able to read messages from upgraded -# servers, first deploy without changing the serializer, then set the serializer -# in a subsequent deploy. -#++ -Rails.application.config.active_support.message_serializer = :json_allow_marshal - -### -# Enable a performance optimization that serializes message data and metadata -# together. This changes the message format, so messages serialized this way -# cannot be read by older versions of Rails. However, messages that use the old -# format can still be read, regardless of whether this optimization is enabled. -# -# To perform a rolling deploy of a Rails 7.1 upgrade, wherein servers that have -# not yet been upgraded must be able to read messages from upgraded servers, -# leave this optimization off on the first deploy, then enable it on a -# subsequent deploy. -#++ -Rails.application.config.active_support.use_message_serializer_for_metadata = true - -### -# Set the maximum size for Rails log files. -# -# `config.load_defaults 7.1` does not set this value for environments other than -# development and test. -#++ -Rails.application.config.log_file_size = 100 * 1024 * 1024 if Rails.env.local? - -### -# Enable raising on assignment to attr_readonly attributes. The previous -# behavior would allow assignment but silently not persist changes to the -# database. -#++ -Rails.application.config.active_record.raise_on_assign_to_attr_readonly = true - -### -# Enable validating only parent-related columns for presence when the parent is mandatory. -# The previous behavior was to validate the presence of the parent record, which performed an extra query -# to get the parent every time the child record was updated, even when parent has not changed. -#++ -Rails.application.config.active_record.belongs_to_required_validates_foreign_key = false - -### -# Enable precompilation of `config.filter_parameters`. Precompilation can -# improve filtering performance, depending on the quantity and types of filters. -#++ -Rails.application.config.precompile_filter_parameters = true - -### -# Enable before_committed! callbacks on all enrolled records in a transaction. -# The previous behavior was to only run the callbacks on the first copy of a record -# if there were multiple copies of the same record enrolled in the transaction. -#++ -Rails.application.config.active_record.before_committed_on_all_records = true - -### -# Disable automatic column serialization into YAML. -# To keep the historic behavior, you can set it to `YAML`, however it is -# recommended to explicitly define the serialization method for each column -# rather than to rely on a global default. -#++ -Rails.application.config.active_record.default_column_serializer = nil - -### -# Enable a performance optimization that serializes Active Record models -# in a faster and more compact way. -# -# To perform a rolling deploy of a Rails 7.1 upgrade, wherein servers that have -# not yet been upgraded must be able to read caches from upgraded servers, -# leave this optimization off on the first deploy, then enable it on a -# subsequent deploy. -#++ -# Rails.application.config.active_record.marshalling_format_version = 7.1 - -### -# Run `after_commit` and `after_*_commit` callbacks in the order they are defined in a model. -# This matches the behaviour of all other callbacks. -# In previous versions of Rails, they ran in the inverse order. -#++ -Rails.application.config.active_record.run_after_transaction_callbacks_in_order_defined = true - -### -# Whether a `transaction` block is committed or rolled back when exited via `return`, `break` or `throw`. -#++ -Rails.application.config.active_record.commit_transaction_on_non_local_return = true - -### -# Controls when to generate a value for has_secure_token declarations. -#++ -Rails.application.config.active_record.generate_secure_token_on = :initialize - -### -# ** Please read carefully, this must be configured in config/application.rb ** -# -# Change the format of the cache entry. -# -# Changing this default means that all new cache entries added to the cache -# will have a different format that is not supported by Rails 7.0 -# applications. -# -# Only change this value after your application is fully deployed to Rails 7.1 -# and you have no plans to rollback. -# When you're ready to change format, add this to `config/application.rb` (NOT -# this file): -# config.active_support.cache_format_version = 7.1 - -### -# Configure the log level used by the DebugExceptions middleware when logging -# uncaught exceptions during requests. -#++ -Rails.application.config.action_dispatch.debug_exception_log_level = :error - -### -# Configure the test helpers in Action View, Action Dispatch, and rails-dom-testing to use HTML5 -# parsers. -# -# Nokogiri::HTML5 isn't supported on JRuby, so JRuby applications must set this to :html4. -# -# In previous versions of Rails, these test helpers always used an HTML4 parser. -#++ -Rails.application.config.dom_testing_default_html_version = :html5 From f9b57e6d507b38220933191ae672bd82f1216f6a Mon Sep 17 00:00:00 2001 From: lodewiges <131907615+lodewiges@users.noreply.github.com> Date: Fri, 28 Mar 2025 23:49:16 +0100 Subject: [PATCH 39/39] Update Gemfile.lock --- Gemfile.lock | 1 - 1 file changed, 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2470c0fd..f0815015 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -67,7 +67,6 @@ GEM benchmark (>= 0.3) bigdecimal concurrent-ruby (~> 1.0, >= 1.3.1) - concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2)