Skip to content

Commit f7328d9

Browse files
authored
Merge pull request #2463 from olleolleolle/rails81
Update to Rails 8.1
2 parents b18aa2b + facbe80 commit f7328d9

16 files changed

Lines changed: 237 additions & 92 deletions

File tree

Gemfile

Lines changed: 1 addition & 1 deletion
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', '~> 8.0.4' # LOCKED: It is Rails.
4+
gem 'rails', '~> 8.1.2' # LOCKED: It is Rails.
55
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
66
gem 'sprockets-rails'
77

Gemfile.lock

Lines changed: 62 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -19,72 +19,75 @@ GIT
1919
GEM
2020
remote: https://rubygems.org/
2121
specs:
22-
actioncable (8.0.4)
23-
actionpack (= 8.0.4)
24-
activesupport (= 8.0.4)
22+
action_text-trix (2.1.16)
23+
railties
24+
actioncable (8.1.2)
25+
actionpack (= 8.1.2)
26+
activesupport (= 8.1.2)
2527
nio4r (~> 2.0)
2628
websocket-driver (>= 0.6.1)
2729
zeitwerk (~> 2.6)
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)
30+
actionmailbox (8.1.2)
31+
actionpack (= 8.1.2)
32+
activejob (= 8.1.2)
33+
activerecord (= 8.1.2)
34+
activestorage (= 8.1.2)
35+
activesupport (= 8.1.2)
3436
mail (>= 2.8.0)
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)
37+
actionmailer (8.1.2)
38+
actionpack (= 8.1.2)
39+
actionview (= 8.1.2)
40+
activejob (= 8.1.2)
41+
activesupport (= 8.1.2)
4042
mail (>= 2.8.0)
4143
rails-dom-testing (~> 2.2)
42-
actionpack (8.0.4)
43-
actionview (= 8.0.4)
44-
activesupport (= 8.0.4)
44+
actionpack (8.1.2)
45+
actionview (= 8.1.2)
46+
activesupport (= 8.1.2)
4547
nokogiri (>= 1.8.5)
4648
rack (>= 2.2.4)
4749
rack-session (>= 1.0.1)
4850
rack-test (>= 0.6.3)
4951
rails-dom-testing (~> 2.2)
5052
rails-html-sanitizer (~> 1.6)
5153
useragent (~> 0.16)
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)
54+
actiontext (8.1.2)
55+
action_text-trix (~> 2.1.15)
56+
actionpack (= 8.1.2)
57+
activerecord (= 8.1.2)
58+
activestorage (= 8.1.2)
59+
activesupport (= 8.1.2)
5760
globalid (>= 0.6.0)
5861
nokogiri (>= 1.8.5)
59-
actionview (8.0.4)
60-
activesupport (= 8.0.4)
62+
actionview (8.1.2)
63+
activesupport (= 8.1.2)
6164
builder (~> 3.1)
6265
erubi (~> 1.11)
6366
rails-dom-testing (~> 2.2)
6467
rails-html-sanitizer (~> 1.6)
65-
activejob (8.0.4)
66-
activesupport (= 8.0.4)
68+
activejob (8.1.2)
69+
activesupport (= 8.1.2)
6770
globalid (>= 0.3.6)
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)
71+
activemodel (8.1.2)
72+
activesupport (= 8.1.2)
73+
activerecord (8.1.2)
74+
activemodel (= 8.1.2)
75+
activesupport (= 8.1.2)
7376
timeout (>= 0.4.0)
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)
77+
activestorage (8.1.2)
78+
actionpack (= 8.1.2)
79+
activejob (= 8.1.2)
80+
activerecord (= 8.1.2)
81+
activesupport (= 8.1.2)
7982
marcel (~> 1.0)
80-
activesupport (8.0.4)
83+
activesupport (8.1.2)
8184
base64
82-
benchmark (>= 0.3)
8385
bigdecimal
8486
concurrent-ruby (~> 1.0, >= 1.3.1)
8587
connection_pool (>= 2.2.5)
8688
drb
8789
i18n (>= 1.6, < 2)
90+
json
8891
logger (>= 1.4.2)
8992
minitest (>= 5.1)
9093
securerandom (>= 0.3)
@@ -229,7 +232,7 @@ GEM
229232
thor (~> 1.4)
230233
friendly_id (5.6.0)
231234
activerecord (>= 4.0.0)
232-
globalid (1.2.1)
235+
globalid (1.3.0)
233236
activesupport (>= 6.1)
234237
google-protobuf (4.33.2-aarch64-linux-gnu)
235238
bigdecimal
@@ -302,7 +305,8 @@ GEM
302305
loofah (2.25.0)
303306
crass (~> 1.0.2)
304307
nokogiri (>= 1.12.0)
305-
mail (2.8.1)
308+
mail (2.9.0)
309+
logger
306310
mini_mime (>= 0.1.1)
307311
net-imap
308312
net-pop
@@ -323,7 +327,7 @@ GEM
323327
mutex_m (0.3.0)
324328
net-http (0.6.0)
325329
uri
326-
net-imap (0.5.10)
330+
net-imap (0.6.2)
327331
date
328332
net-protocol
329333
net-pop (0.1.2)
@@ -435,20 +439,20 @@ GEM
435439
rack (>= 1.3)
436440
rackup (2.3.1)
437441
rack (>= 3)
438-
rails (8.0.4)
439-
actioncable (= 8.0.4)
440-
actionmailbox (= 8.0.4)
441-
actionmailer (= 8.0.4)
442-
actionpack (= 8.0.4)
443-
actiontext (= 8.0.4)
444-
actionview (= 8.0.4)
445-
activejob (= 8.0.4)
446-
activemodel (= 8.0.4)
447-
activerecord (= 8.0.4)
448-
activestorage (= 8.0.4)
449-
activesupport (= 8.0.4)
442+
rails (8.1.2)
443+
actioncable (= 8.1.2)
444+
actionmailbox (= 8.1.2)
445+
actionmailer (= 8.1.2)
446+
actionpack (= 8.1.2)
447+
actiontext (= 8.1.2)
448+
actionview (= 8.1.2)
449+
activejob (= 8.1.2)
450+
activemodel (= 8.1.2)
451+
activerecord (= 8.1.2)
452+
activestorage (= 8.1.2)
453+
activesupport (= 8.1.2)
450454
bundler (>= 1.15.0)
451-
railties (= 8.0.4)
455+
railties (= 8.1.2)
452456
rails-dom-testing (2.3.0)
453457
activesupport (>= 5.0.0)
454458
minitest
@@ -462,9 +466,9 @@ GEM
462466
rack
463467
railties (>= 5.1)
464468
semantic_logger (~> 4.16)
465-
railties (8.0.4)
466-
actionpack (= 8.0.4)
467-
activesupport (= 8.0.4)
469+
railties (8.1.2)
470+
actionpack (= 8.1.2)
471+
activesupport (= 8.1.2)
468472
irb (~> 1.13)
469473
rackup (>= 1.0.0)
470474
rake (>= 12.2)
@@ -699,7 +703,7 @@ DEPENDENCIES
699703
puma (~> 7.2)
700704
pundit
701705
rack-mini-profiler (~> 4.0)
702-
rails (~> 8.0.4)
706+
rails (~> 8.1.2)
703707
rails-html-sanitizer (~> 1.6.2)
704708
rails4-autocomplete
705709
rails_semantic_logger

bin/ci

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env ruby
2+
require_relative "../config/boot"
3+
require "active_support/continuous_integration"
4+
5+
CI = ActiveSupport::ContinuousIntegration
6+
require_relative "../config/ci.rb"

bin/rubocop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require "rubygems"
33
require "bundler/setup"
44

5-
# explicit rubocop config increases performance slightly while avoiding config confusion.
5+
# Explicit RuboCop config increases performance slightly while avoiding config confusion.
66
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))
77

88
load Gem.bin_path("rubocop", "rubocop")

bin/setup

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ FileUtils.chdir APP_ROOT do
2222

2323
puts "\n== Preparing database =="
2424
system! "bin/rails db:prepare"
25+
system! "bin/rails db:reset" if ARGV.include?("--reset")
2526

2627
puts "\n== Removing old logs and tempfiles =="
2728
system! "bin/rails log:clear tmp:clear"

config/application.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
require_relative "boot"
22

33
require "rails/all"
4-
require "sprockets/railtie"
54

65
# Require the gems listed in Gemfile, including any gems
76
# you've limited to :test, :development, or :production.
@@ -10,7 +9,7 @@
109
module Planner
1110
class Application < Rails::Application
1211
# Initialize configuration defaults for originally generated Rails version.
13-
config.load_defaults 8.0
12+
config.load_defaults 8.1
1413

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

config/ci.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Run using bin/ci
2+
3+
CI.run do
4+
step "Setup", "bin/setup --skip-server"
5+
6+
step "Style: Ruby", "bin/rubocop"
7+
8+
step "Security: Importmap vulnerability audit", "bin/importmap audit"
9+
step "Tests: Rails", "bin/rails test"
10+
step "Tests: Seeds", "env RAILS_ENV=test bin/rails db:seed:replant"
11+
12+
# Optional: Run system tests
13+
# step "Tests: System", "bin/rails test:system"
14+
15+
# Optional: set a green GitHub commit status to unblock PR merge.
16+
# Requires the `gh` CLI and `gh extension install basecamp/gh-signoff`.
17+
# if success?
18+
# step "Signoff: All systems go. Ready for merge and deploy.", "gh signoff"
19+
# else
20+
# failure "Signoff: CI failed. Do not merge or deploy.", "Fix the issues and try again."
21+
# end
22+
end

config/environments/development.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@
6161
# Suppress logger output for asset requests.
6262
config.assets.quiet = true
6363

64+
# Highlight code that triggered redirect in logs.
65+
config.action_dispatch.verbose_redirect_logs = true
66+
6467
# Raises error for missing translations.
6568
# config.i18n.raise_on_missing_translations = true
6669

config/environments/production.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
config.log_tags = [ :request_id ]
4343
config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
4444

45-
# Change to "debug" to log everything (including potentially personally-identifiable information!)
45+
# Change to "debug" to log everything (including potentially personally-identifiable information!).
4646
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
4747

4848
# Prevent health checks from clogging up the logs.

config/initializers/content_security_policy.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
2121
# config.content_security_policy_nonce_directives = %w(script-src style-src)
2222
#
23+
# # Automatically add `nonce` to `javascript_tag`, `javascript_include_tag`, and `stylesheet_link_tag`
24+
# # if the corresponding directives are specified in `content_security_policy_nonce_directives`.
25+
# # config.content_security_policy_nonce_auto = true
26+
#
2327
# # Report violations without enforcing the policy.
2428
# # config.content_security_policy_report_only = true
2529
# end

0 commit comments

Comments
 (0)