Skip to content

Commit 0f9ea3f

Browse files
authored
Merge pull request #926 from MITLibraries/rails72
Upgrading to Rails 7.2.x and Ruby 3.4.x
2 parents ccefb04 + f118253 commit 0f9ea3f

File tree

18 files changed

+212
-140
lines changed

18 files changed

+212
-140
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2.9
1+
3.4.6

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
source 'https://rubygems.org'
22
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
33

4-
ruby '3.2.9'
4+
ruby '3.4.6'
55

66
gem 'bootsnap', require: false
77
gem 'devise'
@@ -15,7 +15,7 @@ gem 'opensearch-ruby'
1515
gem 'puma'
1616
gem 'rack-attack'
1717
gem 'rack-cors'
18-
gem 'rails', '~> 7.1.0'
18+
gem 'rails', '~> 7.2.0'
1919
gem 'redis'
2020
gem 'sass-rails'
2121
gem 'sentry-rails'
@@ -27,7 +27,7 @@ group :production do
2727
end
2828

2929
group :development, :test do
30-
gem 'byebug', platforms: %i[mri mingw x64_mingw]
30+
gem 'byebug'
3131
gem 'dotenv-rails'
3232
gem 'sqlite3'
3333
end

Gemfile.lock

Lines changed: 68 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -10,83 +10,77 @@ GIT
1010
GEM
1111
remote: https://rubygems.org/
1212
specs:
13-
actioncable (7.1.5.2)
14-
actionpack (= 7.1.5.2)
15-
activesupport (= 7.1.5.2)
13+
actioncable (7.2.2.2)
14+
actionpack (= 7.2.2.2)
15+
activesupport (= 7.2.2.2)
1616
nio4r (~> 2.0)
1717
websocket-driver (>= 0.6.1)
1818
zeitwerk (~> 2.6)
19-
actionmailbox (7.1.5.2)
20-
actionpack (= 7.1.5.2)
21-
activejob (= 7.1.5.2)
22-
activerecord (= 7.1.5.2)
23-
activestorage (= 7.1.5.2)
24-
activesupport (= 7.1.5.2)
25-
mail (>= 2.7.1)
26-
net-imap
27-
net-pop
28-
net-smtp
29-
actionmailer (7.1.5.2)
30-
actionpack (= 7.1.5.2)
31-
actionview (= 7.1.5.2)
32-
activejob (= 7.1.5.2)
33-
activesupport (= 7.1.5.2)
34-
mail (~> 2.5, >= 2.5.4)
35-
net-imap
36-
net-pop
37-
net-smtp
19+
actionmailbox (7.2.2.2)
20+
actionpack (= 7.2.2.2)
21+
activejob (= 7.2.2.2)
22+
activerecord (= 7.2.2.2)
23+
activestorage (= 7.2.2.2)
24+
activesupport (= 7.2.2.2)
25+
mail (>= 2.8.0)
26+
actionmailer (7.2.2.2)
27+
actionpack (= 7.2.2.2)
28+
actionview (= 7.2.2.2)
29+
activejob (= 7.2.2.2)
30+
activesupport (= 7.2.2.2)
31+
mail (>= 2.8.0)
3832
rails-dom-testing (~> 2.2)
39-
actionpack (7.1.5.2)
40-
actionview (= 7.1.5.2)
41-
activesupport (= 7.1.5.2)
33+
actionpack (7.2.2.2)
34+
actionview (= 7.2.2.2)
35+
activesupport (= 7.2.2.2)
4236
nokogiri (>= 1.8.5)
4337
racc
44-
rack (>= 2.2.4)
38+
rack (>= 2.2.4, < 3.2)
4539
rack-session (>= 1.0.1)
4640
rack-test (>= 0.6.3)
4741
rails-dom-testing (~> 2.2)
4842
rails-html-sanitizer (~> 1.6)
49-
actiontext (7.1.5.2)
50-
actionpack (= 7.1.5.2)
51-
activerecord (= 7.1.5.2)
52-
activestorage (= 7.1.5.2)
53-
activesupport (= 7.1.5.2)
43+
useragent (~> 0.16)
44+
actiontext (7.2.2.2)
45+
actionpack (= 7.2.2.2)
46+
activerecord (= 7.2.2.2)
47+
activestorage (= 7.2.2.2)
48+
activesupport (= 7.2.2.2)
5449
globalid (>= 0.6.0)
5550
nokogiri (>= 1.8.5)
56-
actionview (7.1.5.2)
57-
activesupport (= 7.1.5.2)
51+
actionview (7.2.2.2)
52+
activesupport (= 7.2.2.2)
5853
builder (~> 3.1)
5954
erubi (~> 1.11)
6055
rails-dom-testing (~> 2.2)
6156
rails-html-sanitizer (~> 1.6)
62-
activejob (7.1.5.2)
63-
activesupport (= 7.1.5.2)
57+
activejob (7.2.2.2)
58+
activesupport (= 7.2.2.2)
6459
globalid (>= 0.3.6)
65-
activemodel (7.1.5.2)
66-
activesupport (= 7.1.5.2)
67-
activerecord (7.1.5.2)
68-
activemodel (= 7.1.5.2)
69-
activesupport (= 7.1.5.2)
60+
activemodel (7.2.2.2)
61+
activesupport (= 7.2.2.2)
62+
activerecord (7.2.2.2)
63+
activemodel (= 7.2.2.2)
64+
activesupport (= 7.2.2.2)
7065
timeout (>= 0.4.0)
71-
activestorage (7.1.5.2)
72-
actionpack (= 7.1.5.2)
73-
activejob (= 7.1.5.2)
74-
activerecord (= 7.1.5.2)
75-
activesupport (= 7.1.5.2)
66+
activestorage (7.2.2.2)
67+
actionpack (= 7.2.2.2)
68+
activejob (= 7.2.2.2)
69+
activerecord (= 7.2.2.2)
70+
activesupport (= 7.2.2.2)
7671
marcel (~> 1.0)
77-
activesupport (7.1.5.2)
72+
activesupport (7.2.2.2)
7873
base64
7974
benchmark (>= 0.3)
8075
bigdecimal
81-
concurrent-ruby (~> 1.0, >= 1.0.2)
76+
concurrent-ruby (~> 1.0, >= 1.3.1)
8277
connection_pool (>= 2.2.5)
8378
drb
8479
i18n (>= 1.6, < 2)
8580
logger (>= 1.4.2)
8681
minitest (>= 5.1)
87-
mutex_m
8882
securerandom (>= 0.3)
89-
tzinfo (~> 2.0)
83+
tzinfo (~> 2.0, >= 2.0.5)
9084
addressable (2.8.7)
9185
public_suffix (>= 2.0.2, < 7.0)
9286
annotate (3.2.0)
@@ -158,7 +152,7 @@ GEM
158152
activesupport (>= 4.0)
159153
terminal-table (>= 1.8)
160154
forwardable-extended (2.6.0)
161-
globalid (1.2.1)
155+
globalid (1.3.0)
162156
activesupport (>= 6.1)
163157
google-protobuf (4.30.0)
164158
bigdecimal
@@ -233,15 +227,14 @@ GEM
233227
net-imap
234228
net-pop
235229
net-smtp
236-
marcel (1.0.4)
230+
marcel (1.1.0)
237231
matrix (0.4.2)
238232
mercenary (0.4.0)
239233
mini_mime (1.1.5)
240234
mini_portile2 (2.8.9)
241235
minitest (5.25.5)
242236
msgpack (1.8.0)
243237
multi_json (1.15.0)
244-
mutex_m (0.3.0)
245238
net-http (0.6.0)
246239
uri
247240
net-imap (0.5.11)
@@ -279,7 +272,7 @@ GEM
279272
puma (7.0.4)
280273
nio4r (~> 2.0)
281274
racc (1.8.1)
282-
rack (3.2.1)
275+
rack (3.1.16)
283276
rack-attack (6.7.0)
284277
rack (>= 1.0, < 4)
285278
rack-cors (3.0.0)
@@ -292,31 +285,31 @@ GEM
292285
rack (>= 1.3)
293286
rackup (2.2.1)
294287
rack (>= 3)
295-
rails (7.1.5.2)
296-
actioncable (= 7.1.5.2)
297-
actionmailbox (= 7.1.5.2)
298-
actionmailer (= 7.1.5.2)
299-
actionpack (= 7.1.5.2)
300-
actiontext (= 7.1.5.2)
301-
actionview (= 7.1.5.2)
302-
activejob (= 7.1.5.2)
303-
activemodel (= 7.1.5.2)
304-
activerecord (= 7.1.5.2)
305-
activestorage (= 7.1.5.2)
306-
activesupport (= 7.1.5.2)
288+
rails (7.2.2.2)
289+
actioncable (= 7.2.2.2)
290+
actionmailbox (= 7.2.2.2)
291+
actionmailer (= 7.2.2.2)
292+
actionpack (= 7.2.2.2)
293+
actiontext (= 7.2.2.2)
294+
actionview (= 7.2.2.2)
295+
activejob (= 7.2.2.2)
296+
activemodel (= 7.2.2.2)
297+
activerecord (= 7.2.2.2)
298+
activestorage (= 7.2.2.2)
299+
activesupport (= 7.2.2.2)
307300
bundler (>= 1.15.0)
308-
railties (= 7.1.5.2)
301+
railties (= 7.2.2.2)
309302
rails-dom-testing (2.3.0)
310303
activesupport (>= 5.0.0)
311304
minitest
312305
nokogiri (>= 1.6)
313306
rails-html-sanitizer (1.6.2)
314307
loofah (~> 2.21)
315308
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)
316-
railties (7.1.5.2)
317-
actionpack (= 7.1.5.2)
318-
activesupport (= 7.1.5.2)
319-
irb
309+
railties (7.2.2.2)
310+
actionpack (= 7.2.2.2)
311+
activesupport (= 7.2.2.2)
312+
irb (~> 1.13)
320313
rackup (>= 1.0.0)
321314
rake (>= 12.2)
322315
thor (~> 1.0, >= 1.2.2)
@@ -421,6 +414,7 @@ GEM
421414
execjs (>= 0.3.0, < 3)
422415
unicode-display_width (2.6.0)
423416
uri (1.0.3)
417+
useragent (0.16.11)
424418
vcr (6.3.1)
425419
base64
426420
warden (1.2.9)
@@ -436,7 +430,7 @@ GEM
436430
hashdiff (>= 0.4.0, < 2.0.0)
437431
webrick (1.9.1)
438432
websocket (1.2.11)
439-
websocket-driver (0.7.7)
433+
websocket-driver (0.8.0)
440434
base64
441435
websocket-extensions (>= 0.1.0)
442436
websocket-extensions (0.1.5)
@@ -470,7 +464,7 @@ DEPENDENCIES
470464
puma
471465
rack-attack
472466
rack-cors
473-
rails (~> 7.1.0)
467+
rails (~> 7.2.0)
474468
redis
475469
rubocop
476470
rubocop-rails
@@ -488,7 +482,7 @@ DEPENDENCIES
488482
webmock
489483

490484
RUBY VERSION
491-
ruby 3.2.9p265
485+
ruby 3.4.6p54
492486

493487
BUNDLED WITH
494-
2.6.3
488+
2.7.2

bin/rubocop

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env ruby
2+
require "rubygems"
3+
require "bundler/setup"
4+
5+
# explicit rubocop config increases performance slightly while avoiding config confusion.
6+
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))
7+
8+
load Gem.bin_path("rubocop", "rubocop")

bin/setup

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

4-
# path to your application root.
54
APP_ROOT = File.expand_path("..", __dir__)
5+
APP_NAME = "timdex"
66

77
def system!(*args)
88
system(*args, exception: true)
@@ -30,4 +30,8 @@ FileUtils.chdir APP_ROOT do
3030

3131
puts "\n== Restarting application server =="
3232
system! "bin/rails restart"
33+
34+
# puts "\n== Configuring puma-dev =="
35+
# system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
36+
# system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
3337
end

config/application.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Application < Rails::Application
2626
config.flipflop.dashboard_access_filter = -> { head :forbidden }
2727

2828
# Initialize configuration defaults for originally generated Rails version.
29-
config.load_defaults 7.1
29+
config.load_defaults 7.2
3030

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

config/environments/development.rb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Show full error reports.
1919
config.consider_all_requests_local = true
2020

21-
# Enable server timing
21+
# Enable server timing.
2222
config.server_timing = true
2323

2424
# Enable/disable caching. By default caching is disabled.
@@ -28,9 +28,7 @@
2828
config.action_controller.enable_fragment_cache_logging = true
2929

3030
config.cache_store = :memory_store
31-
config.public_file_server.headers = {
32-
"Cache-Control" => "public, max-age=#{2.days.to_i}"
33-
}
31+
config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" }
3432
else
3533
config.action_controller.perform_caching = false
3634

@@ -40,8 +38,12 @@
4038
# Don't care if the mailer can't send.
4139
config.action_mailer.raise_delivery_errors = false
4240

41+
# Disable caching for Action Mailer templates even if Action Controller
42+
# caching is enabled.
4343
config.action_mailer.perform_caching = false
4444

45+
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
46+
4547
# Print deprecation notices to the Rails logger.
4648
config.active_support.deprecation = :log
4749

@@ -76,6 +78,9 @@
7678
# Uncomment if you wish to allow Action Cable access from any origin.
7779
# config.action_cable.disable_request_forgery_protection = true
7880

79-
# Raise error when a before_action's only/except options reference missing actions
81+
# Raise error when a before_action's only/except options reference missing actions.
8082
config.action_controller.raise_on_missing_callback_actions = true
83+
84+
# Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
85+
# config.generators.apply_rubocop_autocorrect_after_generate!
8186
end

config/environments/production.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
5050
config.force_ssl = true
5151

52+
# Skip http-to-https redirect for the default health check endpoint.
53+
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
54+
5255
# Log to STDOUT by default
5356
config.logger = ActiveSupport::Logger.new(STDOUT)
5457
.tap { |logger| logger.formatter = ::Logger::Formatter.new }
@@ -70,6 +73,8 @@
7073
# config.active_job.queue_adapter = :resque
7174
# config.active_job.queue_name_prefix = "timdex_production"
7275

76+
# Disable caching for Action Mailer templates even if Action Controller
77+
# caching is enabled.
7378
config.action_mailer.perform_caching = false
7479

7580
# Ignore bad email addresses and do not raise email delivery errors.
@@ -96,6 +101,9 @@
96101
# Do not dump schema after migrations.
97102
config.active_record.dump_schema_after_migration = false
98103

104+
# Only use :id for inspections in production.
105+
config.active_record.attributes_for_inspect = [ :id ]
106+
99107
# Enable DNS rebinding protection and other `Host` header attacks.
100108
# config.hosts = [
101109
# "example.com", # Allow requests from example.com

0 commit comments

Comments
 (0)