Skip to content

Commit be77af0

Browse files
committed
⬆️ Update Rails to 8
1 parent d25dbe1 commit be77af0

19 files changed

+814
-371
lines changed

Gemfile

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

4-
gem 'rails', '~> 7'
4+
gem 'rails', '~> 8'
55

66
# Bundle edge Rails instead:
77
# gem 'rails', :git => 'git://github.com/rails/rails.git'
88

9-
gem 'sqlite3', '~> 1.4'
9+
gem 'sqlite3', '~> 2.1'
1010

1111
gem 'sassc-rails'
1212
gem 'coffee-rails'

Gemfile.lock

Lines changed: 60 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -8,66 +8,65 @@ GEM
88
remote: https://rubygems.org/
99
specs:
1010
SyslogLogger (2.0)
11-
actioncable (7.2.2.1)
12-
actionpack (= 7.2.2.1)
13-
activesupport (= 7.2.2.1)
11+
actioncable (8.0.2)
12+
actionpack (= 8.0.2)
13+
activesupport (= 8.0.2)
1414
nio4r (~> 2.0)
1515
websocket-driver (>= 0.6.1)
1616
zeitwerk (~> 2.6)
17-
actionmailbox (7.2.2.1)
18-
actionpack (= 7.2.2.1)
19-
activejob (= 7.2.2.1)
20-
activerecord (= 7.2.2.1)
21-
activestorage (= 7.2.2.1)
22-
activesupport (= 7.2.2.1)
17+
actionmailbox (8.0.2)
18+
actionpack (= 8.0.2)
19+
activejob (= 8.0.2)
20+
activerecord (= 8.0.2)
21+
activestorage (= 8.0.2)
22+
activesupport (= 8.0.2)
2323
mail (>= 2.8.0)
24-
actionmailer (7.2.2.1)
25-
actionpack (= 7.2.2.1)
26-
actionview (= 7.2.2.1)
27-
activejob (= 7.2.2.1)
28-
activesupport (= 7.2.2.1)
24+
actionmailer (8.0.2)
25+
actionpack (= 8.0.2)
26+
actionview (= 8.0.2)
27+
activejob (= 8.0.2)
28+
activesupport (= 8.0.2)
2929
mail (>= 2.8.0)
3030
rails-dom-testing (~> 2.2)
31-
actionpack (7.2.2.1)
32-
actionview (= 7.2.2.1)
33-
activesupport (= 7.2.2.1)
31+
actionpack (8.0.2)
32+
actionview (= 8.0.2)
33+
activesupport (= 8.0.2)
3434
nokogiri (>= 1.8.5)
35-
racc
36-
rack (>= 2.2.4, < 3.2)
35+
rack (>= 2.2.4)
3736
rack-session (>= 1.0.1)
3837
rack-test (>= 0.6.3)
3938
rails-dom-testing (~> 2.2)
4039
rails-html-sanitizer (~> 1.6)
4140
useragent (~> 0.16)
42-
actiontext (7.2.2.1)
43-
actionpack (= 7.2.2.1)
44-
activerecord (= 7.2.2.1)
45-
activestorage (= 7.2.2.1)
46-
activesupport (= 7.2.2.1)
41+
actiontext (8.0.2)
42+
actionpack (= 8.0.2)
43+
activerecord (= 8.0.2)
44+
activestorage (= 8.0.2)
45+
activesupport (= 8.0.2)
4746
globalid (>= 0.6.0)
4847
nokogiri (>= 1.8.5)
49-
actionview (7.2.2.1)
50-
activesupport (= 7.2.2.1)
48+
actionview (8.0.2)
49+
activesupport (= 8.0.2)
5150
builder (~> 3.1)
5251
erubi (~> 1.11)
5352
rails-dom-testing (~> 2.2)
5453
rails-html-sanitizer (~> 1.6)
55-
activejob (7.2.2.1)
56-
activesupport (= 7.2.2.1)
54+
activejob (8.0.2)
55+
activesupport (= 8.0.2)
5756
globalid (>= 0.3.6)
58-
activemodel (7.2.2.1)
59-
activesupport (= 7.2.2.1)
60-
activerecord (7.2.2.1)
61-
activemodel (= 7.2.2.1)
62-
activesupport (= 7.2.2.1)
57+
activemodel (8.0.2)
58+
activesupport (= 8.0.2)
59+
activerecord (8.0.2)
60+
activemodel (= 8.0.2)
61+
activesupport (= 8.0.2)
6362
timeout (>= 0.4.0)
64-
activestorage (7.2.2.1)
65-
actionpack (= 7.2.2.1)
66-
activejob (= 7.2.2.1)
67-
activerecord (= 7.2.2.1)
68-
activesupport (= 7.2.2.1)
63+
activestorage (8.0.2)
64+
actionpack (= 8.0.2)
65+
activejob (= 8.0.2)
66+
activerecord (= 8.0.2)
67+
activesupport (= 8.0.2)
6968
marcel (~> 1.0)
70-
activesupport (7.2.2.1)
69+
activesupport (8.0.2)
7170
base64
7271
benchmark (>= 0.3)
7372
bigdecimal
@@ -79,6 +78,7 @@ GEM
7978
minitest (>= 5.1)
8079
securerandom (>= 0.3)
8180
tzinfo (~> 2.0, >= 2.0.5)
81+
uri (>= 0.13.1)
8282
autoprefixer-rails (10.4.21.0)
8383
execjs (~> 2)
8484
base64 (0.2.0)
@@ -187,28 +187,28 @@ GEM
187187
puma (6.6.0)
188188
nio4r (~> 2.0)
189189
racc (1.8.1)
190-
rack (3.1.14)
190+
rack (3.1.15)
191191
rack-session (2.1.1)
192192
base64 (>= 0.1.0)
193193
rack (>= 3.0.0)
194194
rack-test (2.2.0)
195195
rack (>= 1.3)
196196
rackup (2.2.1)
197197
rack (>= 3)
198-
rails (7.2.2.1)
199-
actioncable (= 7.2.2.1)
200-
actionmailbox (= 7.2.2.1)
201-
actionmailer (= 7.2.2.1)
202-
actionpack (= 7.2.2.1)
203-
actiontext (= 7.2.2.1)
204-
actionview (= 7.2.2.1)
205-
activejob (= 7.2.2.1)
206-
activemodel (= 7.2.2.1)
207-
activerecord (= 7.2.2.1)
208-
activestorage (= 7.2.2.1)
209-
activesupport (= 7.2.2.1)
198+
rails (8.0.2)
199+
actioncable (= 8.0.2)
200+
actionmailbox (= 8.0.2)
201+
actionmailer (= 8.0.2)
202+
actionpack (= 8.0.2)
203+
actiontext (= 8.0.2)
204+
actionview (= 8.0.2)
205+
activejob (= 8.0.2)
206+
activemodel (= 8.0.2)
207+
activerecord (= 8.0.2)
208+
activestorage (= 8.0.2)
209+
activesupport (= 8.0.2)
210210
bundler (>= 1.15.0)
211-
railties (= 7.2.2.1)
211+
railties (= 8.0.2)
212212
rails-controller-testing (1.0.5)
213213
actionpack (>= 5.0.1.rc1)
214214
actionview (>= 5.0.1.rc1)
@@ -220,9 +220,9 @@ GEM
220220
rails-html-sanitizer (1.6.2)
221221
loofah (~> 2.21)
222222
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)
223-
railties (7.2.2.1)
224-
actionpack (= 7.2.2.1)
225-
activesupport (= 7.2.2.1)
223+
railties (8.0.2)
224+
actionpack (= 8.0.2)
225+
activesupport (= 8.0.2)
226226
irb (~> 1.13)
227227
rackup (>= 1.0.0)
228228
rake (>= 12.2)
@@ -266,7 +266,7 @@ GEM
266266
actionpack (>= 6.1)
267267
activesupport (>= 6.1)
268268
sprockets (>= 3.0.0)
269-
sqlite3 (1.7.3)
269+
sqlite3 (2.6.0)
270270
mini_portile2 (~> 2.8.0)
271271
stringio (3.1.7)
272272
temple (0.10.3)
@@ -279,6 +279,7 @@ GEM
279279
concurrent-ruby (~> 1.0)
280280
uglifier (4.2.1)
281281
execjs (>= 0.3.0, < 3)
282+
uri (1.0.3)
282283
useragent (0.16.11)
283284
websocket-driver (0.7.7)
284285
base64
@@ -307,15 +308,15 @@ DEPENDENCIES
307308
minitest
308309
pg
309310
puma
310-
rails (~> 7)
311+
rails (~> 8)
311312
rails-controller-testing
312313
ruby-prof
313314
sassc-rails
314315
sentry-rails
315316
sentry-ruby
316317
simple_form
317318
spring
318-
sqlite3 (~> 1.4)
319+
sqlite3 (~> 2.1)
319320
uglifier
320321

321322
BUNDLED WITH

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: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
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)
8-
system(*args) || abort("\n== Command #{args} failed ==")
7+
system(*args, exception: true)
98
end
109

1110
FileUtils.chdir APP_ROOT do
@@ -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: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ module Mete
1010
class Application < Rails::Application
1111
# Initialize configuration defaults for originally generated Rails version.
1212
config.load_defaults 7.0
13-
config.action_dispatch.cookies_serializer = :hybrid
13+
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])
1418

1519
# Configuration for the application, engines, and railties goes here.
1620
#

config/environments/development.rb

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,67 @@
33
Rails.application.configure do
44
# Settings specified here will take precedence over those in config/application.rb.
55

6-
# In the development environment your application's code is reloaded any time
7-
# it changes. This slows down response time but is perfect for development
8-
# since you don't have to restart the web server when you make code changes.
9-
config.cache_classes = false
6+
# Make code changes take effect immediately without server restart.
7+
config.enable_reloading = true
108

119
# Do not eager load code on boot.
1210
config.eager_load = false
1311

1412
# Show full error reports.
1513
config.consider_all_requests_local = true
1614

17-
# Enable server timing
15+
# Enable server timing.
1816
config.server_timing = true
1917

18+
# Enable/disable Action Controller caching. By default Action Controller caching is disabled.
19+
# Run rails dev:cache to toggle Action Controller caching.
20+
if Rails.root.join("tmp/caching-dev.txt").exist?
21+
config.action_controller.perform_caching = true
22+
config.action_controller.enable_fragment_cache_logging = true
23+
config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" }
24+
else
25+
config.action_controller.perform_caching = false
26+
end
27+
28+
# Change to :null_store to avoid any caching.
29+
config.cache_store = :memory_store
30+
2031
# Store uploaded files on the local file system (see config/storage.yml for options).
2132
config.active_storage.service = :local
2233

2334
# Don't care if the mailer can't send.
2435
config.action_mailer.raise_delivery_errors = false
2536

37+
# Make template changes take effect immediately.
2638
config.action_mailer.perform_caching = false
2739

40+
# Set localhost to be used by links generated in mailer templates.
41+
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
42+
2843
# Print deprecation notices to the Rails logger.
2944
config.active_support.deprecation = :log
3045

31-
# Raise exceptions for disallowed deprecations.
32-
config.active_support.disallowed_deprecation = :raise
33-
34-
# Tell Active Support which deprecation messages to disallow.
35-
config.active_support.disallowed_deprecation_warnings = []
36-
3746
# Raise an error on page load if there are pending migrations.
3847
config.active_record.migration_error = :page_load
3948

4049
# Highlight code that triggered database queries in logs.
4150
config.active_record.verbose_query_logs = true
4251

43-
# Suppress logger output for asset requests.
44-
config.assets.quiet = true
52+
# Append comments with runtime information tags to SQL queries in logs.
53+
config.active_record.query_log_tags_enabled = true
54+
55+
# Highlight code that enqueued background job in logs.
56+
config.active_job.verbose_enqueue_logs = true
4557

4658
# Raises error for missing translations.
4759
# config.i18n.raise_on_missing_translations = true
4860

4961
# Annotate rendered view with file names.
50-
# config.action_view.annotate_rendered_view_with_filenames = true
62+
config.action_view.annotate_rendered_view_with_filenames = true
5163

5264
# Uncomment if you wish to allow Action Cable access from any origin.
5365
# config.action_cable.disable_request_forgery_protection = true
66+
67+
# Raise error when a before_action's only/except options reference missing actions.
68+
config.action_controller.raise_on_missing_callback_actions = true
5469
end

0 commit comments

Comments
 (0)