Skip to content

Commit 31270c4

Browse files
committed
upgrade rails from 7.1 to 7.2
it's recommended to upgrade to the next major version instead of jumping directly to v8.0
1 parent 3e1f722 commit 31270c4

27 files changed

+417
-298
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ gem "shakapacker", "8.0.0"
1010

1111
# Bundle edge Rails instead: gem "rails", github: "rails/rails"
1212
gem "listen"
13-
gem "rails", "~> 7.1"
13+
gem "rails", "~> 7.2"
1414

1515
gem "pg"
1616

Gemfile.lock

Lines changed: 71 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -7,87 +7,85 @@ GIT
77
GEM
88
remote: https://rubygems.org/
99
specs:
10-
actioncable (7.1.3.4)
11-
actionpack (= 7.1.3.4)
12-
activesupport (= 7.1.3.4)
10+
actioncable (7.2.2)
11+
actionpack (= 7.2.2)
12+
activesupport (= 7.2.2)
1313
nio4r (~> 2.0)
1414
websocket-driver (>= 0.6.1)
1515
zeitwerk (~> 2.6)
16-
actionmailbox (7.1.3.4)
17-
actionpack (= 7.1.3.4)
18-
activejob (= 7.1.3.4)
19-
activerecord (= 7.1.3.4)
20-
activestorage (= 7.1.3.4)
21-
activesupport (= 7.1.3.4)
22-
mail (>= 2.7.1)
23-
net-imap
24-
net-pop
25-
net-smtp
26-
actionmailer (7.1.3.4)
27-
actionpack (= 7.1.3.4)
28-
actionview (= 7.1.3.4)
29-
activejob (= 7.1.3.4)
30-
activesupport (= 7.1.3.4)
31-
mail (~> 2.5, >= 2.5.4)
32-
net-imap
33-
net-pop
34-
net-smtp
16+
actionmailbox (7.2.2)
17+
actionpack (= 7.2.2)
18+
activejob (= 7.2.2)
19+
activerecord (= 7.2.2)
20+
activestorage (= 7.2.2)
21+
activesupport (= 7.2.2)
22+
mail (>= 2.8.0)
23+
actionmailer (7.2.2)
24+
actionpack (= 7.2.2)
25+
actionview (= 7.2.2)
26+
activejob (= 7.2.2)
27+
activesupport (= 7.2.2)
28+
mail (>= 2.8.0)
3529
rails-dom-testing (~> 2.2)
36-
actionpack (7.1.3.4)
37-
actionview (= 7.1.3.4)
38-
activesupport (= 7.1.3.4)
30+
actionpack (7.2.2)
31+
actionview (= 7.2.2)
32+
activesupport (= 7.2.2)
3933
nokogiri (>= 1.8.5)
4034
racc
41-
rack (>= 2.2.4)
35+
rack (>= 2.2.4, < 3.2)
4236
rack-session (>= 1.0.1)
4337
rack-test (>= 0.6.3)
4438
rails-dom-testing (~> 2.2)
4539
rails-html-sanitizer (~> 1.6)
46-
actiontext (7.1.3.4)
47-
actionpack (= 7.1.3.4)
48-
activerecord (= 7.1.3.4)
49-
activestorage (= 7.1.3.4)
50-
activesupport (= 7.1.3.4)
40+
useragent (~> 0.16)
41+
actiontext (7.2.2)
42+
actionpack (= 7.2.2)
43+
activerecord (= 7.2.2)
44+
activestorage (= 7.2.2)
45+
activesupport (= 7.2.2)
5146
globalid (>= 0.6.0)
5247
nokogiri (>= 1.8.5)
53-
actionview (7.1.3.4)
54-
activesupport (= 7.1.3.4)
48+
actionview (7.2.2)
49+
activesupport (= 7.2.2)
5550
builder (~> 3.1)
5651
erubi (~> 1.11)
5752
rails-dom-testing (~> 2.2)
5853
rails-html-sanitizer (~> 1.6)
59-
activejob (7.1.3.4)
60-
activesupport (= 7.1.3.4)
54+
activejob (7.2.2)
55+
activesupport (= 7.2.2)
6156
globalid (>= 0.3.6)
62-
activemodel (7.1.3.4)
63-
activesupport (= 7.1.3.4)
64-
activerecord (7.1.3.4)
65-
activemodel (= 7.1.3.4)
66-
activesupport (= 7.1.3.4)
57+
activemodel (7.2.2)
58+
activesupport (= 7.2.2)
59+
activerecord (7.2.2)
60+
activemodel (= 7.2.2)
61+
activesupport (= 7.2.2)
6762
timeout (>= 0.4.0)
68-
activestorage (7.1.3.4)
69-
actionpack (= 7.1.3.4)
70-
activejob (= 7.1.3.4)
71-
activerecord (= 7.1.3.4)
72-
activesupport (= 7.1.3.4)
63+
activestorage (7.2.2)
64+
actionpack (= 7.2.2)
65+
activejob (= 7.2.2)
66+
activerecord (= 7.2.2)
67+
activesupport (= 7.2.2)
7368
marcel (~> 1.0)
74-
activesupport (7.1.3.4)
69+
activesupport (7.2.2)
7570
base64
71+
benchmark (>= 0.3)
7672
bigdecimal
77-
concurrent-ruby (~> 1.0, >= 1.0.2)
73+
concurrent-ruby (~> 1.0, >= 1.3.1)
7874
connection_pool (>= 2.2.5)
7975
drb
8076
i18n (>= 1.6, < 2)
77+
logger (>= 1.4.2)
8178
minitest (>= 5.1)
82-
mutex_m
83-
tzinfo (~> 2.0)
79+
securerandom (>= 0.3)
80+
tzinfo (~> 2.0, >= 2.0.5)
8481
addressable (2.8.7)
8582
public_suffix (>= 2.0.2, < 7.0)
8683
ast (2.4.2)
8784
autoprefixer-rails (10.4.16.0)
8885
execjs (~> 2)
8986
awesome_print (1.9.2)
9087
base64 (0.2.0)
88+
benchmark (0.4.0)
9189
bigdecimal (3.1.8)
9290
bindex (0.8.1)
9391
binding_of_caller (1.0.1)
@@ -131,7 +129,7 @@ GEM
131129
activerecord (>= 5.a)
132130
database_cleaner-core (~> 2.0.0)
133131
database_cleaner-core (2.0.1)
134-
date (3.3.4)
132+
date (3.4.0)
135133
debug (1.9.2)
136134
irb (~> 1.10)
137135
reline (>= 0.3.8)
@@ -148,6 +146,8 @@ GEM
148146
factory_bot (~> 6.4)
149147
railties (>= 5.0.0)
150148
ffi (1.17.0)
149+
ffi (1.17.0-arm64-darwin)
150+
ffi (1.17.0-x86_64-linux-gnu)
151151
foreman (0.88.1)
152152
generator_spec (0.10.0)
153153
activesupport (>= 3.0.0)
@@ -188,8 +188,7 @@ GEM
188188
minitest (5.24.1)
189189
mize (0.4.1)
190190
protocol (~> 2.0)
191-
mutex_m (0.2.0)
192-
net-imap (0.4.14)
191+
net-imap (0.5.1)
193192
date
194193
net-protocol
195194
net-protocol (0.2.2)
@@ -245,20 +244,20 @@ GEM
245244
rackup (2.1.0)
246245
rack (>= 3)
247246
webrick (~> 1.8)
248-
rails (7.1.3.4)
249-
actioncable (= 7.1.3.4)
250-
actionmailbox (= 7.1.3.4)
251-
actionmailer (= 7.1.3.4)
252-
actionpack (= 7.1.3.4)
253-
actiontext (= 7.1.3.4)
254-
actionview (= 7.1.3.4)
255-
activejob (= 7.1.3.4)
256-
activemodel (= 7.1.3.4)
257-
activerecord (= 7.1.3.4)
258-
activestorage (= 7.1.3.4)
259-
activesupport (= 7.1.3.4)
247+
rails (7.2.2)
248+
actioncable (= 7.2.2)
249+
actionmailbox (= 7.2.2)
250+
actionmailer (= 7.2.2)
251+
actionpack (= 7.2.2)
252+
actiontext (= 7.2.2)
253+
actionview (= 7.2.2)
254+
activejob (= 7.2.2)
255+
activemodel (= 7.2.2)
256+
activerecord (= 7.2.2)
257+
activestorage (= 7.2.2)
258+
activesupport (= 7.2.2)
260259
bundler (>= 1.15.0)
261-
railties (= 7.1.3.4)
260+
railties (= 7.2.2)
262261
rails-dom-testing (2.2.0)
263262
activesupport (>= 5.0.0)
264263
minitest
@@ -274,10 +273,10 @@ GEM
274273
json
275274
require_all (~> 3.0)
276275
ruby-progressbar
277-
railties (7.1.3.4)
278-
actionpack (= 7.1.3.4)
279-
activesupport (= 7.1.3.4)
280-
irb
276+
railties (7.2.2)
277+
actionpack (= 7.2.2)
278+
activesupport (= 7.2.2)
279+
irb (~> 1.13)
281280
rackup (>= 1.0.0)
282281
rake (>= 12.2)
283282
thor (~> 1.0, >= 1.2.2)
@@ -364,6 +363,7 @@ GEM
364363
sass (~> 3.5, >= 3.5.5)
365364
sdoc (2.6.1)
366365
rdoc (>= 5.0)
366+
securerandom (0.3.2)
367367
selenium-webdriver (4.22.0)
368368
base64 (~> 0.2)
369369
logger (~> 1.4)
@@ -417,6 +417,7 @@ GEM
417417
uglifier (4.2.0)
418418
execjs (>= 0.3.0, < 3)
419419
unicode-display_width (2.5.0)
420+
useragent (0.16.10)
420421
web-console (4.2.1)
421422
actionview (>= 6.0.0)
422423
activemodel (>= 6.0.0)
@@ -461,7 +462,7 @@ DEPENDENCIES
461462
pry-rescue
462463
pry-stack_explorer
463464
puma
464-
rails (~> 7.1)
465+
rails (~> 7.2)
465466
rails-html-sanitizer
466467
rails_best_practices
467468
rainbow

bin/rails

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env ruby
2-
APP_PATH = File.expand_path('../config/application', __dir__)
2+
APP_PATH = File.expand_path("../config/application", __dir__)
33
require_relative "../config/boot"
44
require "rails/commands"

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: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
11
#!/usr/bin/env ruby
22
require "fileutils"
33

4-
# path to your application root.
5-
APP_ROOT = File.expand_path('..', __dir__)
4+
APP_ROOT = File.expand_path("..", __dir__)
5+
APP_NAME = "rails-react-tutorial"
66

77
def system!(*args)
8-
system(*args) || abort("\n== Command #{args} failed ==")
8+
system(*args, exception: true)
99
end
1010

1111
FileUtils.chdir APP_ROOT do
1212
# This script is a way to set up or update your development environment automatically.
1313
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
1414
# Add necessary setup steps to this file.
1515

16-
puts '== Installing dependencies =='
17-
system! 'gem install bundler --conservative'
18-
system('bundle check') || system!('bundle install')
19-
20-
# Install JavaScript dependencies
21-
system! 'bin/yarn'
16+
puts "== Installing dependencies =="
17+
system! "gem install bundler --conservative"
18+
system("bundle check") || system!("bundle install")
2219

2320
# puts "\n== Copying sample files =="
24-
# unless File.exist?('config/database.yml')
25-
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
21+
# unless File.exist?("config/database.yml")
22+
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
2623
# end
2724

2825
puts "\n== Preparing database =="
29-
system! 'bin/rails db:prepare'
26+
system! "bin/rails db:prepare"
3027

3128
puts "\n== Removing old logs and tempfiles =="
32-
system! 'bin/rails log:clear tmp:clear'
29+
system! "bin/rails log:clear tmp:clear"
3330

3431
puts "\n== Restarting application server =="
35-
system! 'bin/rails restart'
32+
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"
3637
end

config/application.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# frozen_string_literal: true
2-
31
require_relative "boot"
42

53
require "rails/all"
@@ -13,10 +11,13 @@ class Application < Rails::Application
1311
# Initialize configuration defaults for originally generated Rails version.
1412
config.load_defaults 7.0
1513

16-
# Configuration for the application, engines, and railties goes here.
17-
18-
config.action_cable.allowed_request_origins = [Rails.application.credentials.action_cable_url]
14+
# Please, add to the `ignore` list any other `lib` subdirectories that do
15+
# not contain `.rb` files, or that should not be reloaded or eager loaded.
16+
# Common ones are `templates`, `generators`, or `middleware`, for example.
17+
config.autoload_lib(ignore: %w[assets tasks])
1918

19+
# Configuration for the application, engines, and railties goes here.
20+
#
2021
# These settings can be overridden in specific environments using the files
2122
# in config/environments, which are processed later.
2223
#

config/boot.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# frozen_string_literal: true
2-
31
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
42

53
require "bundler/setup" # Set up gems listed in the Gemfile.

config/database.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ default: &default
3131

3232
development:
3333
<<: *default
34-
database: react-webpack-rails-tutorial
3534

3635
# Warning: The database defined as "test" will be erased and
3736
# re-generated from your development database when you run "rake".

config/environment.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# frozen_string_literal: true
2-
31
# Load the Rails application.
42
require_relative "application"
53

0 commit comments

Comments
 (0)