Skip to content

Commit b2e3164

Browse files
authored
Merge pull request #2393 from olleolleolle/rails80
Upgrade to Rails v8.0
2 parents 095a149 + 8c0719a commit b2e3164

23 files changed

Lines changed: 742 additions & 456 deletions

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
source 'https://rubygems.org'
22
ruby file: '.ruby-version'
33

4-
gem 'rails', '~> 7.2.2.2' # LOCKED: It is Rails.
4+
gem 'rails', '~> 8.0.4' # LOCKED: It is Rails.
55
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
66
gem 'sprockets-rails'
77

@@ -51,7 +51,7 @@ gem 'pagy', '~> 43.2'
5151
gem 'icalendar'
5252
gem 'tzinfo-data'
5353

54-
gem 'chosen-rails'
54+
gem 'chosen-rails', github: 'olleolleolle/chosen-rails', branch: 'support-rails-8'
5555
gem 'commonmarker'
5656

5757
gem 'faraday'

Gemfile.lock

Lines changed: 91 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -6,69 +6,78 @@ GIT
66
sitemap_generator (6.3.0)
77
builder (~> 3.0)
88

9+
GIT
10+
remote: https://github.com/olleolleolle/chosen-rails.git
11+
revision: cfef31cb30ed6d0dfd65cae0ff6f4a2943812df0
12+
branch: support-rails-8
13+
specs:
14+
chosen-rails (2.0.0)
15+
coffee-rails (>= 3.2)
16+
dartsass-rails (>= 0.5.0)
17+
railties (>= 3.0)
18+
919
GEM
1020
remote: https://rubygems.org/
1121
specs:
12-
actioncable (7.2.2.2)
13-
actionpack (= 7.2.2.2)
14-
activesupport (= 7.2.2.2)
22+
actioncable (8.0.4)
23+
actionpack (= 8.0.4)
24+
activesupport (= 8.0.4)
1525
nio4r (~> 2.0)
1626
websocket-driver (>= 0.6.1)
1727
zeitwerk (~> 2.6)
18-
actionmailbox (7.2.2.2)
19-
actionpack (= 7.2.2.2)
20-
activejob (= 7.2.2.2)
21-
activerecord (= 7.2.2.2)
22-
activestorage (= 7.2.2.2)
23-
activesupport (= 7.2.2.2)
28+
actionmailbox (8.0.4)
29+
actionpack (= 8.0.4)
30+
activejob (= 8.0.4)
31+
activerecord (= 8.0.4)
32+
activestorage (= 8.0.4)
33+
activesupport (= 8.0.4)
2434
mail (>= 2.8.0)
25-
actionmailer (7.2.2.2)
26-
actionpack (= 7.2.2.2)
27-
actionview (= 7.2.2.2)
28-
activejob (= 7.2.2.2)
29-
activesupport (= 7.2.2.2)
35+
actionmailer (8.0.4)
36+
actionpack (= 8.0.4)
37+
actionview (= 8.0.4)
38+
activejob (= 8.0.4)
39+
activesupport (= 8.0.4)
3040
mail (>= 2.8.0)
3141
rails-dom-testing (~> 2.2)
32-
actionpack (7.2.2.2)
33-
actionview (= 7.2.2.2)
34-
activesupport (= 7.2.2.2)
42+
actionpack (8.0.4)
43+
actionview (= 8.0.4)
44+
activesupport (= 8.0.4)
3545
nokogiri (>= 1.8.5)
36-
racc
37-
rack (>= 2.2.4, < 3.2)
46+
rack (>= 2.2.4)
3847
rack-session (>= 1.0.1)
3948
rack-test (>= 0.6.3)
4049
rails-dom-testing (~> 2.2)
4150
rails-html-sanitizer (~> 1.6)
4251
useragent (~> 0.16)
43-
actiontext (7.2.2.2)
44-
actionpack (= 7.2.2.2)
45-
activerecord (= 7.2.2.2)
46-
activestorage (= 7.2.2.2)
47-
activesupport (= 7.2.2.2)
52+
actiontext (8.0.4)
53+
actionpack (= 8.0.4)
54+
activerecord (= 8.0.4)
55+
activestorage (= 8.0.4)
56+
activesupport (= 8.0.4)
4857
globalid (>= 0.6.0)
4958
nokogiri (>= 1.8.5)
50-
actionview (7.2.2.2)
51-
activesupport (= 7.2.2.2)
59+
actionview (8.0.4)
60+
activesupport (= 8.0.4)
5261
builder (~> 3.1)
5362
erubi (~> 1.11)
5463
rails-dom-testing (~> 2.2)
5564
rails-html-sanitizer (~> 1.6)
56-
activejob (7.2.2.2)
57-
activesupport (= 7.2.2.2)
65+
activejob (8.0.4)
66+
activesupport (= 8.0.4)
5867
globalid (>= 0.3.6)
59-
activemodel (7.2.2.2)
60-
activesupport (= 7.2.2.2)
61-
activerecord (7.2.2.2)
62-
activemodel (= 7.2.2.2)
63-
activesupport (= 7.2.2.2)
68+
activemodel (8.0.4)
69+
activesupport (= 8.0.4)
70+
activerecord (8.0.4)
71+
activemodel (= 8.0.4)
72+
activesupport (= 8.0.4)
6473
timeout (>= 0.4.0)
65-
activestorage (7.2.2.2)
66-
actionpack (= 7.2.2.2)
67-
activejob (= 7.2.2.2)
68-
activerecord (= 7.2.2.2)
69-
activesupport (= 7.2.2.2)
74+
activestorage (8.0.4)
75+
actionpack (= 8.0.4)
76+
activejob (= 8.0.4)
77+
activerecord (= 8.0.4)
78+
activesupport (= 8.0.4)
7079
marcel (~> 1.0)
71-
activesupport (7.2.2.2)
80+
activesupport (8.0.4)
7281
base64
7382
benchmark (>= 0.3)
7483
bigdecimal
@@ -80,6 +89,7 @@ GEM
8089
minitest (>= 5.1)
8190
securerandom (>= 0.3)
8291
tzinfo (~> 2.0, >= 2.0.5)
92+
uri (>= 0.13.1)
8393
acts-as-taggable-on (13.0.0)
8494
activerecord (>= 7.1, < 8.2)
8595
zeitwerk (>= 2.4, < 3.0)
@@ -145,10 +155,6 @@ GEM
145155
carrierwave (>= 2.0, < 4)
146156
childprocess (5.1.0)
147157
logger (~> 1.5)
148-
chosen-rails (1.10.0)
149-
coffee-rails (>= 3.2)
150-
railties (>= 3.0)
151-
sassc-rails (>= 2.1.2)
152158
cocoon (1.2.15)
153159
coderay (1.1.3)
154160
coffee-rails (5.0.0)
@@ -171,6 +177,9 @@ GEM
171177
css_parser (1.14.0)
172178
addressable
173179
csv (3.3.5)
180+
dartsass-rails (0.5.1)
181+
railties (>= 6.0.0)
182+
sass-embedded (~> 1.63)
174183
database_cleaner (2.1.0)
175184
database_cleaner-active_record (>= 2, < 3)
176185
database_cleaner-active_record (2.2.2)
@@ -218,6 +227,18 @@ GEM
218227
activerecord (>= 4.0.0)
219228
globalid (1.2.1)
220229
activesupport (>= 6.1)
230+
google-protobuf (4.33.2-aarch64-linux-gnu)
231+
bigdecimal
232+
rake (>= 13)
233+
google-protobuf (4.33.2-arm64-darwin)
234+
bigdecimal
235+
rake (>= 13)
236+
google-protobuf (4.33.2-x86_64-darwin)
237+
bigdecimal
238+
rake (>= 13)
239+
google-protobuf (4.33.2-x86_64-linux-gnu)
240+
bigdecimal
241+
rake (>= 13)
221242
haml (7.2.0)
222243
temple (>= 0.8.2)
223244
thor
@@ -402,20 +423,20 @@ GEM
402423
rack (>= 1.3)
403424
rackup (2.3.1)
404425
rack (>= 3)
405-
rails (7.2.2.2)
406-
actioncable (= 7.2.2.2)
407-
actionmailbox (= 7.2.2.2)
408-
actionmailer (= 7.2.2.2)
409-
actionpack (= 7.2.2.2)
410-
actiontext (= 7.2.2.2)
411-
actionview (= 7.2.2.2)
412-
activejob (= 7.2.2.2)
413-
activemodel (= 7.2.2.2)
414-
activerecord (= 7.2.2.2)
415-
activestorage (= 7.2.2.2)
416-
activesupport (= 7.2.2.2)
426+
rails (8.0.4)
427+
actioncable (= 8.0.4)
428+
actionmailbox (= 8.0.4)
429+
actionmailer (= 8.0.4)
430+
actionpack (= 8.0.4)
431+
actiontext (= 8.0.4)
432+
actionview (= 8.0.4)
433+
activejob (= 8.0.4)
434+
activemodel (= 8.0.4)
435+
activerecord (= 8.0.4)
436+
activestorage (= 8.0.4)
437+
activesupport (= 8.0.4)
417438
bundler (>= 1.15.0)
418-
railties (= 7.2.2.2)
439+
railties (= 8.0.4)
419440
rails-dom-testing (2.3.0)
420441
activesupport (>= 5.0.0)
421442
minitest
@@ -429,13 +450,14 @@ GEM
429450
rack
430451
railties (>= 5.1)
431452
semantic_logger (~> 4.16)
432-
railties (7.2.2.2)
433-
actionpack (= 7.2.2.2)
434-
activesupport (= 7.2.2.2)
453+
railties (8.0.4)
454+
actionpack (= 8.0.4)
455+
activesupport (= 8.0.4)
435456
irb (~> 1.13)
436457
rackup (>= 1.0.0)
437458
rake (>= 12.2)
438459
thor (~> 1.0, >= 1.2.2)
460+
tsort (>= 0.2)
439461
zeitwerk (~> 2.6)
440462
rainbow (3.1.1)
441463
rake (13.3.1)
@@ -511,6 +533,14 @@ GEM
511533
ffi (~> 1.12)
512534
logger
513535
rubyzip (3.2.2)
536+
sass-embedded (1.97.0-aarch64-linux-gnu)
537+
google-protobuf (~> 4.31)
538+
sass-embedded (1.97.0-arm64-darwin)
539+
google-protobuf (~> 4.31)
540+
sass-embedded (1.97.0-x86_64-darwin)
541+
google-protobuf (~> 4.31)
542+
sass-embedded (1.97.0-x86_64-linux-gnu)
543+
google-protobuf (~> 4.31)
514544
sassc (2.4.0)
515545
ffi (~> 1.9)
516546
sassc-rails (2.1.2)
@@ -620,7 +650,7 @@ DEPENDENCIES
620650
capybara
621651
carrierwave
622652
carrierwave-aws (~> 1.6)
623-
chosen-rails
653+
chosen-rails!
624654
cocoon
625655
commonmarker
626656
csv
@@ -664,7 +694,7 @@ DEPENDENCIES
664694
puma (~> 6.6)
665695
pundit
666696
rack-mini-profiler (~> 4.0)
667-
rails (~> 7.2.2.2)
697+
rails (~> 8.0.4)
668698
rails-html-sanitizer (~> 1.6.2)
669699
rails4-autocomplete
670700
rails_semantic_logger

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/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/setup

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
require "fileutils"
33

44
APP_ROOT = File.expand_path("..", __dir__)
5-
APP_NAME = "planner"
65

76
def system!(*args)
87
system(*args, exception: true)
@@ -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,10 +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"
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"
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
3734
end

config/application.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010
module Planner
1111
class Application < Rails::Application
1212
# Initialize configuration defaults for originally generated Rails version.
13-
config.load_defaults 7.2
13+
config.load_defaults 8.0
1414

15-
config.autoload_lib(ignore: %w(assets tasks))
15+
# Please, add to the `ignore` list any other `lib` subdirectories that do
16+
# not contain `.rb` files, or that should not be reloaded or eager loaded.
17+
# Common ones are `templates`, `generators`, or `middleware`, for example.
18+
config.autoload_lib(ignore: %w[assets tasks])
1619

1720
# Configuration for the application, engines, and railties goes here.
1821
#

config/boot.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
1+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
22

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

config/environments/development.rb

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
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.
6+
# Make code changes take effect immediately without server restart.
97
config.enable_reloading = true
108

119
# Do not eager load code on boot.
@@ -17,47 +15,46 @@
1715
# Enable server timing.
1816
config.server_timing = true
1917

20-
# Enable/disable caching. By default caching is disabled.
21-
# Run rails dev:cache to toggle caching.
18+
# Enable/disable Action Controller caching. By default Action Controller caching is disabled.
19+
# Run rails dev:cache to toggle Action Controller caching.
2220
if Rails.root.join("tmp/caching-dev.txt").exist?
2321
config.action_controller.perform_caching = true
2422
config.action_controller.enable_fragment_cache_logging = true
25-
2623
config.cache_store = :memory_store
27-
config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" }
24+
config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" }
2825
else
2926
config.action_controller.perform_caching = false
3027

3128
config.cache_store = :null_store
3229
end
3330

31+
# Change to :null_store to avoid any caching.
32+
# config.cache_store = :memory_store
33+
3434
# Store uploaded files on the local file system (see config/storage.yml for options).
3535
config.active_storage.service = :local
3636

3737
# Don't care if the mailer can't send.
3838
config.action_mailer.raise_delivery_errors = false
3939

40-
# Disable caching for Action Mailer templates even if Action Controller
41-
# caching is enabled.
40+
# Make template changes take effect immediately.
4241
config.action_mailer.perform_caching = false
4342

43+
# Set localhost to be used by links generated in mailer templates.
4444
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
4545

4646
# Print deprecation notices to the Rails logger.
4747
config.active_support.deprecation = :log
4848

49-
# Raise exceptions for disallowed deprecations.
50-
config.active_support.disallowed_deprecation = :raise
51-
52-
# Tell Active Support which deprecation messages to disallow.
53-
config.active_support.disallowed_deprecation_warnings = []
54-
5549
# Raise an error on page load if there are pending migrations.
5650
config.active_record.migration_error = :page_load
5751

5852
# Highlight code that triggered database queries in logs.
5953
config.active_record.verbose_query_logs = true
6054

55+
# Append comments with runtime information tags to SQL queries in logs.
56+
config.active_record.query_log_tags_enabled = true
57+
6158
# Highlight code that enqueued background job in logs.
6259
config.active_job.verbose_enqueue_logs = true
6360

0 commit comments

Comments
 (0)