From fe845bfa3626aa1babfd00a22e992311ca3bf38b Mon Sep 17 00:00:00 2001 From: Alex Turchyn Date: Fri, 29 Dec 2023 18:50:14 +0000 Subject: [PATCH] rails v7.1.2 and ruby to v3.3.0 --- Dockerfile | 4 +- Gemfile | 3 +- Gemfile.lock | 348 ++++++++++-------- app/models/account_config.rb | 2 +- app/models/encrypted_config.rb | 2 +- app/models/encrypted_user_config.rb | 2 +- app/models/submission.rb | 8 +- app/models/submission_event.rb | 2 +- app/models/submitter.rb | 4 +- app/models/template.rb | 6 +- app/models/user_config.rb | 2 +- bin/setup | 2 +- config/application.rb | 9 +- config/environments/development.rb | 2 +- config/environments/production.rb | 2 +- config/environments/test.rb | 2 +- config/initializers/devise.rb | 1 + .../initializers/filter_parameter_logging.rb | 3 +- lib/json_web_token.rb | 4 +- lib/submission_events.rb | 2 +- package.json | 2 +- yarn.lock | 8 +- 22 files changed, 226 insertions(+), 194 deletions(-) diff --git a/Dockerfile b/Dockerfile index dc4ee0dc..9ab4fdb4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.2.2-alpine as webpack +FROM ruby:3.3.0-alpine as webpack ENV RAILS_ENV=production ENV NODE_ENV=production @@ -24,7 +24,7 @@ COPY ./app/views ./app/views RUN echo "gem 'shakapacker'" > Gemfile && ./bin/shakapacker -FROM ruby:3.2.2-alpine3.18 as app +FROM ruby:3.3.0-alpine3.18 as app ENV RAILS_ENV=production ENV BUNDLE_WITHOUT="development:test" diff --git a/Gemfile b/Gemfile index da61a3a7..b0c2ebe8 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' -ruby '3.2.2' +ruby '3.3.0' gem 'aws-sdk-s3', require: false gem 'azure-storage-blob', require: false @@ -26,6 +26,7 @@ gem 'pdf-reader' gem 'pg', require: false gem 'premailer-rails' gem 'puma' +gem 'rack' gem 'rails' gem 'rails_autolink' gem 'rails-i18n' diff --git a/Gemfile.lock b/Gemfile.lock index 4654547c..9fbeacfc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,93 +2,102 @@ GEM remote: https://rubygems.org/ specs: Ascii85 (1.1.0) - actioncable (7.0.7) - actionpack (= 7.0.7) - activesupport (= 7.0.7) + actioncable (7.1.2) + actionpack (= 7.1.2) + activesupport (= 7.1.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.7) - actionpack (= 7.0.7) - activejob (= 7.0.7) - activerecord (= 7.0.7) - activestorage (= 7.0.7) - activesupport (= 7.0.7) + zeitwerk (~> 2.6) + actionmailbox (7.1.2) + actionpack (= 7.1.2) + activejob (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.7) - actionpack (= 7.0.7) - actionview (= 7.0.7) - activejob (= 7.0.7) - activesupport (= 7.0.7) + actionmailer (7.1.2) + actionpack (= 7.1.2) + actionview (= 7.1.2) + activejob (= 7.1.2) + activesupport (= 7.1.2) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.7) - actionview (= 7.0.7) - activesupport (= 7.0.7) - rack (~> 2.0, >= 2.2.4) + rails-dom-testing (~> 2.2) + actionpack (7.1.2) + actionview (= 7.1.2) + activesupport (= 7.1.2) + nokogiri (>= 1.8.5) + racc + 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.7) - actionpack (= 7.0.7) - activerecord (= 7.0.7) - activestorage (= 7.0.7) - activesupport (= 7.0.7) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.2) + actionpack (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.7) - activesupport (= 7.0.7) + actionview (7.1.2) + activesupport (= 7.1.2) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.7) - activesupport (= 7.0.7) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.2) + activesupport (= 7.1.2) globalid (>= 0.3.6) - activemodel (7.0.7) - activesupport (= 7.0.7) - activerecord (7.0.7) - activemodel (= 7.0.7) - activesupport (= 7.0.7) - activestorage (7.0.7) - actionpack (= 7.0.7) - activejob (= 7.0.7) - activerecord (= 7.0.7) - activesupport (= 7.0.7) + activemodel (7.1.2) + activesupport (= 7.1.2) + activerecord (7.1.2) + activemodel (= 7.1.2) + activesupport (= 7.1.2) + timeout (>= 0.4.0) + activestorage (7.1.2) + actionpack (= 7.1.2) + activejob (= 7.1.2) + activerecord (= 7.1.2) + activesupport (= 7.1.2) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.7) + activesupport (7.1.2) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) - addressable (2.8.5) + addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) afm (0.2.2) annotate (3.2.0) activerecord (>= 3.2, < 8.0) rake (>= 10.4, < 14.0) ast (2.4.2) - aws-eventstream (1.2.0) - aws-partitions (1.807.0) - aws-sdk-core (3.180.3) - aws-eventstream (~> 1, >= 1.0.2) + aws-eventstream (1.3.0) + aws-partitions (1.874.0) + aws-sdk-core (3.190.1) + aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) - aws-sigv4 (~> 1.5) + aws-sigv4 (~> 1.8) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.71.0) - aws-sdk-core (~> 3, >= 3.177.0) + aws-sdk-kms (1.75.0) + aws-sdk-core (~> 3, >= 3.188.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.132.1) - aws-sdk-core (~> 3, >= 3.179.0) + aws-sdk-s3 (1.142.0) + aws-sdk-core (~> 3, >= 3.189.0) aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.6) - aws-sigv4 (1.6.0) + aws-sigv4 (~> 1.8) + aws-sigv4 (1.8.0) aws-eventstream (~> 1, >= 1.0.2) azure-storage-blob (2.0.3) azure-storage-common (~> 2.0) @@ -98,7 +107,8 @@ GEM faraday_middleware (~> 1.0, >= 1.0.0.rc1) net-http-persistent (~> 4.0) nokogiri (~> 1, >= 1.10.8) - bcrypt (3.1.19) + base64 (0.2.0) + bcrypt (3.1.20) better_html (2.0.2) actionview (>= 6.0) activesupport (>= 6.0) @@ -106,11 +116,12 @@ GEM erubi (~> 1.4) parser (>= 2.4) smart_properties + bigdecimal (3.1.5) bindex (0.8.1) - bootsnap (1.16.0) + bootsnap (1.17.0) msgpack (~> 1.2) builder (3.2.4) - bullet (7.0.7) + bullet (7.1.4) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) cancancan (3.5.0) @@ -131,17 +142,17 @@ GEM crack (0.4.5) rexml crass (1.0.6) - css_parser (1.14.0) + css_parser (1.16.0) addressable - cuprite (0.14.3) + cuprite (0.15) capybara (~> 3.0) - ferrum (~> 0.13.0) - date (3.3.3) - debug (1.8.0) - irb (>= 1.5.0) - reline (>= 0.3.1) + ferrum (~> 0.14.0) + date (3.3.4) + debug (1.9.1) + irb (~> 1.10) + reline (>= 0.3.8) declarative (0.0.20) - devise (4.9.2) + devise (4.9.3) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) @@ -157,8 +168,10 @@ GEM rake (>= 12.0.0, < 14.0.0) docile (1.4.0) dotenv (2.8.1) + drb (2.2.0) + ruby2_keywords email_typo (0.2.3) - erb_lint (0.4.0) + erb_lint (0.5.0) activesupport better_html (>= 2.0.1) parser (>= 2.7.1.4) @@ -166,12 +179,12 @@ GEM rubocop smart_properties erubi (1.12.0) - factory_bot (6.2.1) + factory_bot (6.4.4) activesupport (>= 5.0.0) - factory_bot_rails (6.2.0) - factory_bot (~> 6.2.0) + factory_bot_rails (6.4.2) + factory_bot (~> 6.4) railties (>= 5.0.0) - faker (3.2.1) + faker (3.2.2) i18n (>= 1.8.11, < 2) faraday (1.10.3) faraday-em_http (~> 1.0) @@ -200,16 +213,16 @@ GEM faraday-retry (1.0.3) faraday_middleware (1.2.0) faraday (~> 1.0) - ferrum (0.13) + ferrum (0.14) addressable (~> 2.5) concurrent-ruby (~> 1.1) webrick (~> 1.7) websocket-driver (>= 0.6, < 0.8) - ffi (1.15.5) + ffi (1.16.3) geom2d (0.4.1) - globalid (1.1.0) - activesupport (>= 5.0) - google-apis-core (0.11.1) + globalid (1.2.1) + activesupport (>= 6.1) + google-apis-core (0.11.2) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -220,30 +233,30 @@ GEM webrick google-apis-iamcredentials_v1 (0.17.0) google-apis-core (>= 0.11.0, < 2.a) - google-apis-storage_v1 (0.19.0) - google-apis-core (>= 0.9.0, < 2.a) - google-cloud-core (1.6.0) - google-cloud-env (~> 1.0) + google-apis-storage_v1 (0.29.0) + google-apis-core (>= 0.11.0, < 2.a) + google-cloud-core (1.6.1) + google-cloud-env (>= 1.0, < 3.a) google-cloud-errors (~> 1.0) - google-cloud-env (1.6.0) - faraday (>= 0.17.3, < 3.0) + google-cloud-env (2.1.0) + faraday (>= 1.0, < 3.a) google-cloud-errors (1.3.1) - google-cloud-storage (1.44.0) + google-cloud-storage (1.45.0) addressable (~> 2.8) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.19.0) + google-apis-storage_v1 (~> 0.29.0) google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) - googleauth (1.7.0) - faraday (>= 0.17.3, < 3.a) + googleauth (1.9.1) + faraday (>= 1.0, < 3.a) + google-cloud-env (~> 2.1) jwt (>= 1.4, < 3.0) - memoist (~> 0.16) multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) - hashdiff (1.0.1) + hashdiff (1.1.0) hashery (2.1.2) hexapdf (0.34.1) cmdparse (~> 3.0, >= 3.0.3) @@ -256,11 +269,12 @@ GEM image_processing (1.12.2) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) - io-console (0.6.0) - irb (1.7.4) - reline (>= 0.3.6) + io-console (0.7.1) + irb (1.11.0) + rdoc + reline (>= 0.3.8) jmespath (1.6.2) - json (2.6.3) + json (2.7.1) jwt (2.7.1) language_server-protocol (3.17.0.3) launchy (2.5.2) @@ -272,12 +286,12 @@ GEM letter_opener (~> 1.7) railties (>= 5.2) rexml - lograge (0.13.0) + lograge (0.14.0) actionpack (>= 4) activesupport (>= 4) railties (>= 4) request_store (~> 1.0) - loofah (2.21.3) + loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -287,49 +301,48 @@ GEM net-smtp marcel (1.0.2) matrix (0.4.2) - memoist (0.16.2) method_source (1.0.0) mini_magick (4.12.0) mini_mime (1.1.5) - mini_portile2 (2.8.4) + mini_portile2 (2.8.5) minitest (5.20.0) msgpack (1.7.2) multi_json (1.15.0) multipart-post (2.3.0) + mutex_m (0.2.0) mysql2 (0.5.5) net-http-persistent (4.0.2) connection_pool (~> 2.2) - net-imap (0.3.7) + net-imap (0.4.9) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.4.0) net-protocol - nio4r (2.5.9) - nokogiri (1.15.4) + nio4r (2.7.0) + nokogiri (1.15.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.15.4-arm64-darwin) - racc (~> 1.4) - oj (3.16.0) + oj (3.16.3) + bigdecimal (>= 3.0) openssl (3.2.0) orm_adapter (0.5.0) os (1.1.4) - pagy (6.0.4) - parallel (1.23.0) + pagy (6.2.0) + parallel (1.24.0) parser (3.2.2.4) ast (~> 2.4.1) racc - pdf-reader (2.11.0) + pdf-reader (2.12.0) Ascii85 (~> 1.0) afm (~> 0.2.1) hashery (~> 2.0) ruby-rc4 ttfunk - pg (1.5.3) + pg (1.5.4) premailer (1.21.0) addressable css_parser (>= 1.12.0) @@ -343,29 +356,36 @@ GEM method_source (~> 1.0) pry-rails (0.3.9) pry (>= 0.10.4) - public_suffix (5.0.3) - puma (6.3.1) + psych (5.1.2) + stringio + public_suffix (5.0.4) + puma (6.4.0) nio4r (~> 2.0) - racc (1.7.1) + racc (1.7.3) rack (2.2.8) - rack-proxy (0.7.6) + rack-proxy (0.7.7) rack + rack-session (1.0.2) + rack (< 3) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.7) - actioncable (= 7.0.7) - actionmailbox (= 7.0.7) - actionmailer (= 7.0.7) - actionpack (= 7.0.7) - actiontext (= 7.0.7) - actionview (= 7.0.7) - activejob (= 7.0.7) - activemodel (= 7.0.7) - activerecord (= 7.0.7) - activestorage (= 7.0.7) - activesupport (= 7.0.7) + rackup (1.0.0) + rack (< 3) + webrick + rails (7.1.2) + actioncable (= 7.1.2) + actionmailbox (= 7.1.2) + actionmailer (= 7.1.2) + actionpack (= 7.1.2) + actiontext (= 7.1.2) + actionview (= 7.1.2) + activejob (= 7.1.2) + activemodel (= 7.1.2) + activerecord (= 7.1.2) + activestorage (= 7.1.2) + activesupport (= 7.1.2) bundler (>= 1.15.0) - railties (= 7.0.7) + railties (= 7.1.2) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -380,19 +400,22 @@ GEM actionview (> 3.1) activesupport (> 3.1) railties (> 3.1) - railties (7.0.7) - actionpack (= 7.0.7) - activesupport (= 7.0.7) - method_source + railties (7.1.2) + actionpack (= 7.1.2) + activesupport (= 7.1.2) + irb + 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.0.6) - redis-client (0.16.0) + rake (13.1.0) + rdoc (6.6.2) + psych (>= 4.0.0) + redis-client (0.19.1) connection_pool - regexp_parser (2.8.2) - reline (0.3.8) + regexp_parser (2.8.3) + reline (0.4.1) io-console (~> 0.5) representable (3.2.0) declarative (< 0.1.0) @@ -400,12 +423,12 @@ GEM uber (< 0.2.0) request_store (1.5.1) rack (>= 1.4) - responders (3.1.0) + responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) retriable (3.1.2) rexml (3.2.6) - rollbar (3.4.0) + rollbar (3.4.2) rotp (6.3.0) rqrcode (2.2.0) chunky_png (~> 1.0) @@ -419,7 +442,7 @@ GEM rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-rails (6.0.3) + rspec-rails (6.1.0) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) @@ -428,7 +451,7 @@ GEM rspec-mocks (~> 3.12) rspec-support (~> 3.12) rspec-support (3.12.1) - rubocop (1.57.2) + rubocop (1.59.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -436,7 +459,7 @@ GEM rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.30.0) @@ -445,20 +468,21 @@ GEM rubocop (~> 1.41) rubocop-factory_bot (2.24.0) rubocop (~> 1.33) - rubocop-performance (1.19.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - rubocop-rails (2.22.1) + rubocop-performance (1.20.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) + rubocop-rails (2.23.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) rubocop-rspec (2.25.0) rubocop (~> 1.40) rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) ruby-progressbar (1.13.0) ruby-rc4 (0.1.5) - ruby-vips (2.1.4) + ruby-vips (2.2.0) ffi (~> 1.12) ruby2_keywords (0.0.5) rubyXL (3.4.25) @@ -466,17 +490,17 @@ GEM rubyzip (>= 1.3.0) rubyzip (2.3.2) semantic_range (3.0.0) - shakapacker (7.0.3) + shakapacker (7.1.0) activesupport (>= 5.2) rack-proxy (>= 0.6.1) railties (>= 5.2) semantic_range (>= 2.3.0) - sidekiq (7.1.2) + sidekiq (7.2.0) concurrent-ruby (< 2) connection_pool (>= 2.3.0) rack (>= 2.2.4) redis-client (>= 0.14.0) - signet (0.17.0) + signet (0.18.0) addressable (~> 2.8) faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 3.0) @@ -488,34 +512,35 @@ GEM simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) smart_properties (1.17.0) - sqlite3 (1.6.3) + sqlite3 (1.7.0) mini_portile2 (~> 2.8.0) - sqlite3 (1.6.3-arm64-darwin) + sqlite3 (1.7.0-arm64-darwin) + stringio (3.1.0) strip_attributes (1.13.0) activemodel (>= 3.0, < 8.0) - thor (1.2.2) - timeout (0.4.0) + thor (1.3.0) + timeout (0.4.1) trailblazer-option (0.1.2) ttfunk (1.7.0) - turbo-rails (1.4.0) + turbo-rails (1.5.0) actionpack (>= 6.0.0) activejob (>= 6.0.0) railties (>= 6.0.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - tzinfo-data (1.2023.3) + tzinfo-data (1.2023.4) tzinfo (>= 1.0.0) uber (0.1.0) unicode-display_width (2.5.0) uniform_notifier (1.16.0) warden (1.2.9) rack (>= 2.0.9) - web-console (4.2.0) + web-console (4.2.1) actionview (>= 6.0.0) activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - webmock (3.18.1) + webmock (3.19.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) @@ -525,7 +550,7 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.11) + zeitwerk (2.6.12) PLATFORMS arm64-darwin-22 @@ -565,6 +590,7 @@ DEPENDENCIES premailer-rails pry-rails puma + rack rails rails-i18n rails_autolink @@ -589,7 +615,7 @@ DEPENDENCIES webmock RUBY VERSION - ruby 3.2.2p53 + ruby 3.3.0p0 BUNDLED WITH - 2.4.10 + 2.5.3 diff --git a/app/models/account_config.rb b/app/models/account_config.rb index 2c18e6a3..daaa8058 100644 --- a/app/models/account_config.rb +++ b/app/models/account_config.rb @@ -60,5 +60,5 @@ class AccountConfig < ApplicationRecord belongs_to :account - serialize :value, JSON + serialize :value, coder: JSON end diff --git a/app/models/encrypted_config.rb b/app/models/encrypted_config.rb index 21d51baa..f3c36441 100644 --- a/app/models/encrypted_config.rb +++ b/app/models/encrypted_config.rb @@ -34,5 +34,5 @@ class EncryptedConfig < ApplicationRecord encrypts :value - serialize :value, JSON + serialize :value, coder: JSON end diff --git a/app/models/encrypted_user_config.rb b/app/models/encrypted_user_config.rb index 4bae8b7e..e29d7ff3 100644 --- a/app/models/encrypted_user_config.rb +++ b/app/models/encrypted_user_config.rb @@ -25,5 +25,5 @@ class EncryptedUserConfig < ApplicationRecord encrypts :value - serialize :value, JSON + serialize :value, coder: JSON end diff --git a/app/models/submission.rb b/app/models/submission.rb index 6575cdfc..9cdbf6c2 100644 --- a/app/models/submission.rb +++ b/app/models/submission.rb @@ -39,10 +39,10 @@ class Submission < ApplicationRecord attribute :preferences, :string, default: -> { {} } - serialize :template_fields, JSON - serialize :template_schema, JSON - serialize :template_submitters, JSON - serialize :preferences, JSON + serialize :template_fields, coder: JSON + serialize :template_schema, coder: JSON + serialize :template_submitters, coder: JSON + serialize :preferences, coder: JSON attribute :source, :string, default: 'link' attribute :submitters_order, :string, default: 'random' diff --git a/app/models/submission_event.rb b/app/models/submission_event.rb index e8770501..e9b57e14 100644 --- a/app/models/submission_event.rb +++ b/app/models/submission_event.rb @@ -31,7 +31,7 @@ class SubmissionEvent < ApplicationRecord attribute :data, :string, default: -> { {} } attribute :event_timestamp, :datetime, default: -> { Time.current } - serialize :data, JSON + serialize :data, coder: JSON before_validation :set_submission_id, on: :create diff --git a/app/models/submitter.rb b/app/models/submitter.rb index f5065d7e..7017b0cd 100644 --- a/app/models/submitter.rb +++ b/app/models/submitter.rb @@ -41,8 +41,8 @@ class Submitter < ApplicationRecord attribute :preferences, :string, default: -> { {} } attribute :slug, :string, default: -> { SecureRandom.base58(14) } - serialize :values, JSON - serialize :preferences, JSON + serialize :values, coder: JSON + serialize :preferences, coder: JSON has_many_attached :documents has_many_attached :attachments diff --git a/app/models/template.rb b/app/models/template.rb index cf50532e..03197202 100644 --- a/app/models/template.rb +++ b/app/models/template.rb @@ -47,9 +47,9 @@ class Template < ApplicationRecord attribute :slug, :string, default: -> { SecureRandom.base58(14) } attribute :source, :string, default: 'native' - serialize :fields, JSON - serialize :schema, JSON - serialize :submitters, JSON + serialize :fields, coder: JSON + serialize :schema, coder: JSON + serialize :submitters, coder: JSON has_many_attached :documents diff --git a/app/models/user_config.rb b/app/models/user_config.rb index 5ff3e191..fb9d65d2 100644 --- a/app/models/user_config.rb +++ b/app/models/user_config.rb @@ -25,5 +25,5 @@ class UserConfig < ApplicationRecord belongs_to :user - serialize :value, JSON + serialize :value, coder: JSON end diff --git a/bin/setup b/bin/setup index ec47b79b..3cd5a9d7 100755 --- a/bin/setup +++ b/bin/setup @@ -5,7 +5,7 @@ require "fileutils" APP_ROOT = File.expand_path("..", __dir__) def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") + system(*args, exception: true) end FileUtils.chdir APP_ROOT do diff --git a/config/application.rb b/config/application.rb index 5f737ae3..00926082 100644 --- a/config/application.rb +++ b/config/application.rb @@ -15,10 +15,9 @@ Bundler.require(*Rails.groups) module DocuSeal class Application < Rails::Application - config.load_defaults 7.0 + config.load_defaults 7.1 - config.autoload_paths << Rails.root.join('lib') - config.eager_load_paths << Rails.root.join('lib') + config.autoload_lib(ignore: %w[assets tasks]) config.active_storage.routes_prefix = '' @@ -32,6 +31,10 @@ module DocuSeal config.middleware.insert_before ActionDispatch::Static, Rack::Deflater config.middleware.insert_before ActionDispatch::Static, ApiPathConsiderJsonMiddleware + config.generators.system_tests = nil + + autoloaders.once.do_not_eager_load("#{Turbo::Engine.root}/app/channels") # https://github.com/hotwired/turbo-rails/issues/512 + ActiveSupport.run_load_hooks(:application_config, self) end end diff --git a/config/environments/development.rb b/config/environments/development.rb index 78916919..d75ceead 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -17,7 +17,7 @@ Rails.application.configure do # In the development environment your application's code is reloaded any time # it changes. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. - config.cache_classes = false + config.enable_reloading = true # Do not eager load code on boot. config.eager_load = false diff --git a/config/environments/production.rb b/config/environments/production.rb index 3b8aad99..34930dd4 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -7,7 +7,7 @@ Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. - config.cache_classes = true + config.enable_reloading = false config.public_file_server.headers = { 'Cache-Control' => 'public, s-maxage=31536000, max-age=15552000', diff --git a/config/environments/test.rb b/config/environments/test.rb index abd18e61..90067fcf 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -11,7 +11,7 @@ Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Turn false under Spring and add config.action_view.cache_template_loading = true. - config.cache_classes = true + config.enable_reloading = false # Eager loading loads your whole application. When running a single test locally, # this probably isn't necessary. It's a good idea to do in a continuous integration diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index ca340260..d8321f88 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -20,6 +20,7 @@ Devise.setup do |config| # confirmation, reset password and unlock tokens in the database. # Devise will use the `secret_key_base` as its `secret_key` # by default. You can change it below and use your own secret key. + config.secret_key = Rails.application.secret_key_base # ==> Controller configuration # Configure the parent class to the devise controllers. diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index a87cbaa0..48441140 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -1,3 +1,4 @@ # frozen_string_literal: true -Rails.application.config.filter_parameters += %i[password token otp_attempt] +Rails.application.config.filter_parameters += %i[password token otp_attempt passw secret token _key crypt salt + certificate otp ssn] diff --git a/lib/json_web_token.rb b/lib/json_web_token.rb index a19dc8d7..a6a3affd 100644 --- a/lib/json_web_token.rb +++ b/lib/json_web_token.rb @@ -4,10 +4,10 @@ module JsonWebToken module_function def encode(payload) - JWT.encode(payload, Rails.application.secrets.secret_key_base) + JWT.encode(payload, Rails.application.credentials.secret_key_base) end def decode(token) - JWT.decode(token, Rails.application.secrets.secret_key_base)[0] + JWT.decode(token, Rails.application.credentials.secret_key_base)[0] end end diff --git a/lib/submission_events.rb b/lib/submission_events.rb index c873522f..5afb0575 100644 --- a/lib/submission_events.rb +++ b/lib/submission_events.rb @@ -21,7 +21,7 @@ module SubmissionEvents def build_tracking_param(submitter, event_type = 'click_email') Base64.urlsafe_encode64( - [submitter.slug, event_type, Rails.application.secrets.secret_key_base].join(':') + [submitter.slug, event_type, Rails.application.credentials.secret_key_base].join(':') ).first(TRACKING_PARAM_LENGTH) end diff --git a/package.json b/package.json index 36706394..73c8a3e1 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "postcss-loader": "^7.3.0", "sass": "^1.62.1", "sass-loader": "^13.2.2", - "shakapacker": "7.0.3", + "shakapacker": "7.1.0", "signature_pad": "^4.1.5", "tailwindcss": "^3.3.2", "terser-webpack-plugin": "5.3.8", diff --git a/yarn.lock b/yarn.lock index 66f2a241..c696ad67 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4832,10 +4832,10 @@ setprototypeof@1.2.0: resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== -shakapacker@7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/shakapacker/-/shakapacker-7.0.3.tgz#e67fca4e74c3ef380e1acf53a1d51ab4784ca01c" - integrity sha512-2kwNP8kadkmGOqb7Bp/iNzF3bV31zni8b35Uzst2DZHjnFcnDbW96MERXHc7lS3p3AmKJVbUBmHAFCPsLT9tcw== +shakapacker@7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/shakapacker/-/shakapacker-7.1.0.tgz#95bd37db60702ffa21f9ea29a88f438de3db25b2" + integrity sha512-xKfF4LKrFQdMLYeIi/uBV6pfkPTO4lgCAIMx3W5+MHW61ENOXu4WeQ50qVR9u5hV6XXzi7AiS7C6dWO2GFnYAg== dependencies: glob "^7.2.0" js-yaml "^4.1.0"