Skip to content

Commit c251a7e

Browse files
committed
Upgrade Framework to Rails 8.0
* Disable `Rails/StrongParametersExpect` cop. * Update configuration defaults. * Update the `db:await` task to use modern ActiveRecord API. Ref: AP-270
1 parent 6cf7556 commit c251a7e

12 files changed

Lines changed: 128 additions & 155 deletions

File tree

.idea/altmedia.iml

Lines changed: 23 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.rubocop.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,13 @@ Rails/SelectMap: # new in 2.21
553553
Enabled: true
554554
Rails/StripHeredoc: # new in 2.15
555555
Enabled: true
556+
557+
# This changes all .require.permit to .expect, which is not always what we want.
558+
# For example, it means all parameters are required, which would break the
559+
# proxy borrower form (a middle name would be required for the researcher).
556560
Rails/StrongParametersExpect: # new in 2.29
557-
Enabled: true
561+
Enabled: false
562+
558563
Rails/ThreeStateBooleanColumn: # new in 2.19
559564
Enabled: true
560565
Rails/ToFormattedS: # new in 2.15

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ gem 'omniauth-rails_csrf_protection', '~> 1.0'
3131
gem 'pg', '~> 1.2'
3232
gem 'prawn', '~> 2.4'
3333
gem 'puma', '~> 4.3', '>= 4.3.12'
34-
gem 'rails', '~> 7.2.3'
34+
gem 'rails', '~> 8.0.4'
3535
gem 'recaptcha', '~> 4.13'
3636
gem 'sprockets', '~> 4.0'
3737
gem 'tzinfo-data', platforms: %i[windows jruby]

Gemfile.lock

Lines changed: 57 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,65 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (7.2.3)
5-
actionpack (= 7.2.3)
6-
activesupport (= 7.2.3)
4+
actioncable (8.0.4)
5+
actionpack (= 8.0.4)
6+
activesupport (= 8.0.4)
77
nio4r (~> 2.0)
88
websocket-driver (>= 0.6.1)
99
zeitwerk (~> 2.6)
10-
actionmailbox (7.2.3)
11-
actionpack (= 7.2.3)
12-
activejob (= 7.2.3)
13-
activerecord (= 7.2.3)
14-
activestorage (= 7.2.3)
15-
activesupport (= 7.2.3)
10+
actionmailbox (8.0.4)
11+
actionpack (= 8.0.4)
12+
activejob (= 8.0.4)
13+
activerecord (= 8.0.4)
14+
activestorage (= 8.0.4)
15+
activesupport (= 8.0.4)
1616
mail (>= 2.8.0)
17-
actionmailer (7.2.3)
18-
actionpack (= 7.2.3)
19-
actionview (= 7.2.3)
20-
activejob (= 7.2.3)
21-
activesupport (= 7.2.3)
17+
actionmailer (8.0.4)
18+
actionpack (= 8.0.4)
19+
actionview (= 8.0.4)
20+
activejob (= 8.0.4)
21+
activesupport (= 8.0.4)
2222
mail (>= 2.8.0)
2323
rails-dom-testing (~> 2.2)
24-
actionpack (7.2.3)
25-
actionview (= 7.2.3)
26-
activesupport (= 7.2.3)
27-
cgi
24+
actionpack (8.0.4)
25+
actionview (= 8.0.4)
26+
activesupport (= 8.0.4)
2827
nokogiri (>= 1.8.5)
29-
racc
30-
rack (>= 2.2.4, < 3.3)
28+
rack (>= 2.2.4)
3129
rack-session (>= 1.0.1)
3230
rack-test (>= 0.6.3)
3331
rails-dom-testing (~> 2.2)
3432
rails-html-sanitizer (~> 1.6)
3533
useragent (~> 0.16)
36-
actiontext (7.2.3)
37-
actionpack (= 7.2.3)
38-
activerecord (= 7.2.3)
39-
activestorage (= 7.2.3)
40-
activesupport (= 7.2.3)
34+
actiontext (8.0.4)
35+
actionpack (= 8.0.4)
36+
activerecord (= 8.0.4)
37+
activestorage (= 8.0.4)
38+
activesupport (= 8.0.4)
4139
globalid (>= 0.6.0)
4240
nokogiri (>= 1.8.5)
43-
actionview (7.2.3)
44-
activesupport (= 7.2.3)
41+
actionview (8.0.4)
42+
activesupport (= 8.0.4)
4543
builder (~> 3.1)
46-
cgi
4744
erubi (~> 1.11)
4845
rails-dom-testing (~> 2.2)
4946
rails-html-sanitizer (~> 1.6)
50-
activejob (7.2.3)
51-
activesupport (= 7.2.3)
47+
activejob (8.0.4)
48+
activesupport (= 8.0.4)
5249
globalid (>= 0.3.6)
53-
activemodel (7.2.3)
54-
activesupport (= 7.2.3)
55-
activerecord (7.2.3)
56-
activemodel (= 7.2.3)
57-
activesupport (= 7.2.3)
50+
activemodel (8.0.4)
51+
activesupport (= 8.0.4)
52+
activerecord (8.0.4)
53+
activemodel (= 8.0.4)
54+
activesupport (= 8.0.4)
5855
timeout (>= 0.4.0)
59-
activestorage (7.2.3)
60-
actionpack (= 7.2.3)
61-
activejob (= 7.2.3)
62-
activerecord (= 7.2.3)
63-
activesupport (= 7.2.3)
56+
activestorage (8.0.4)
57+
actionpack (= 8.0.4)
58+
activejob (= 8.0.4)
59+
activerecord (= 8.0.4)
60+
activesupport (= 8.0.4)
6461
marcel (~> 1.0)
65-
activesupport (7.2.3)
62+
activesupport (8.0.4)
6663
base64
6764
benchmark (>= 0.3)
6865
bigdecimal
@@ -74,6 +71,7 @@ GEM
7471
minitest (>= 5.1)
7572
securerandom (>= 0.3)
7673
tzinfo (~> 2.0, >= 2.0.5)
74+
uri (>= 0.13.1)
7775
addressable (2.8.1)
7876
public_suffix (>= 2.0.2, < 6.0)
7977
amazing_print (1.8.1)
@@ -144,7 +142,6 @@ GEM
144142
rack-test (>= 0.6.3)
145143
regexp_parser (>= 1.5, < 3.0)
146144
xpath (~> 3.2)
147-
cgi (0.5.1)
148145
childprocess (4.1.0)
149146
colorize (1.1.0)
150147
concurrent-ruby (1.3.5)
@@ -319,31 +316,30 @@ GEM
319316
rackup (1.0.1)
320317
rack (< 3)
321318
webrick
322-
rails (7.2.3)
323-
actioncable (= 7.2.3)
324-
actionmailbox (= 7.2.3)
325-
actionmailer (= 7.2.3)
326-
actionpack (= 7.2.3)
327-
actiontext (= 7.2.3)
328-
actionview (= 7.2.3)
329-
activejob (= 7.2.3)
330-
activemodel (= 7.2.3)
331-
activerecord (= 7.2.3)
332-
activestorage (= 7.2.3)
333-
activesupport (= 7.2.3)
319+
rails (8.0.4)
320+
actioncable (= 8.0.4)
321+
actionmailbox (= 8.0.4)
322+
actionmailer (= 8.0.4)
323+
actionpack (= 8.0.4)
324+
actiontext (= 8.0.4)
325+
actionview (= 8.0.4)
326+
activejob (= 8.0.4)
327+
activemodel (= 8.0.4)
328+
activerecord (= 8.0.4)
329+
activestorage (= 8.0.4)
330+
activesupport (= 8.0.4)
334331
bundler (>= 1.15.0)
335-
railties (= 7.2.3)
332+
railties (= 8.0.4)
336333
rails-dom-testing (2.3.0)
337334
activesupport (>= 5.0.0)
338335
minitest
339336
nokogiri (>= 1.6)
340337
rails-html-sanitizer (1.6.2)
341338
loofah (~> 2.21)
342339
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
343-
railties (7.2.3)
344-
actionpack (= 7.2.3)
345-
activesupport (= 7.2.3)
346-
cgi
340+
railties (8.0.4)
341+
actionpack (= 8.0.4)
342+
activesupport (= 8.0.4)
347343
irb (~> 1.13)
348344
rackup (>= 1.0.0)
349345
rake (>= 12.2)
@@ -482,6 +478,7 @@ GEM
482478
unicode-display_width (3.1.4)
483479
unicode-emoji (~> 4.0, >= 4.0.4)
484480
unicode-emoji (4.0.4)
481+
uri (1.1.1)
485482
useragent (0.16.11)
486483
web-console (4.2.0)
487484
actionview (>= 6.0.0)
@@ -543,7 +540,7 @@ DEPENDENCIES
543540
pg (~> 1.2)
544541
prawn (~> 2.4)
545542
puma (~> 4.3, >= 4.3.12)
546-
rails (~> 7.2.3)
543+
rails (~> 8.0.4)
547544
recaptcha (~> 4.13)
548545
roo (~> 2.8)
549546
rspec (~> 3.13)

bin/dev

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env ruby
2+
exec "./bin/rails", "server", *ARGV

bin/setup

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env ruby
22
require "fileutils"
33

4-
# path to your application root.
54
APP_ROOT = File.expand_path("..", __dir__)
65

76
def system!(*args)
@@ -14,7 +13,6 @@ FileUtils.chdir APP_ROOT do
1413
# Add necessary setup steps to this file.
1514

1615
puts "== Installing dependencies =="
17-
system! "gem install bundler --conservative"
1816
system("bundle check") || system!("bundle install")
1917

2018
# puts "\n== Copying sample files =="
@@ -28,6 +26,9 @@ FileUtils.chdir APP_ROOT do
2826
puts "\n== Removing old logs and tempfiles =="
2927
system! "bin/rails log:clear tmp:clear"
3028

31-
puts "\n== Restarting application server =="
32-
system! "bin/rails restart"
29+
unless ARGV.include?("--skip-server")
30+
puts "\n== Starting development server =="
31+
STDOUT.flush # flush the output before exec(2) so that it displays
32+
exec "bin/dev"
33+
end
3334
end

config/application.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def log_active_storage_root!(active_storage_root)
5151

5252
end
5353

54-
config.load_defaults 7.2
54+
config.load_defaults 8.0
5555

5656
# Please, add to the `ignore` list any other `lib` subdirectories that do
5757
# not contain `.rb` files, or that should not be reloaded or eager loaded.

0 commit comments

Comments
 (0)