Skip to content

Commit 400d9e7

Browse files
committed
Update to rails 8.1
1 parent 040020b commit 400d9e7

8 files changed

Lines changed: 150 additions & 66 deletions

File tree

Gemfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
source "https://rubygems.org"
22

3-
gem "rails", "~> 8.0.0"
4-
gem "minitest", "< 6"
3+
gem "rails", "~> 8.1.0"
54

65
gem "sprockets-rails"
76
gem "jsbundling-rails", ">= 1.3.0"

Gemfile.lock

Lines changed: 60 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,75 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (8.0.4)
5-
actionpack (= 8.0.4)
6-
activesupport (= 8.0.4)
4+
action_text-trix (2.1.16)
5+
railties
6+
actioncable (8.1.2)
7+
actionpack (= 8.1.2)
8+
activesupport (= 8.1.2)
79
nio4r (~> 2.0)
810
websocket-driver (>= 0.6.1)
911
zeitwerk (~> 2.6)
10-
actionmailbox (8.0.4)
11-
actionpack (= 8.0.4)
12-
activejob (= 8.0.4)
13-
activerecord (= 8.0.4)
14-
activestorage (= 8.0.4)
15-
activesupport (= 8.0.4)
12+
actionmailbox (8.1.2)
13+
actionpack (= 8.1.2)
14+
activejob (= 8.1.2)
15+
activerecord (= 8.1.2)
16+
activestorage (= 8.1.2)
17+
activesupport (= 8.1.2)
1618
mail (>= 2.8.0)
17-
actionmailer (8.0.4)
18-
actionpack (= 8.0.4)
19-
actionview (= 8.0.4)
20-
activejob (= 8.0.4)
21-
activesupport (= 8.0.4)
19+
actionmailer (8.1.2)
20+
actionpack (= 8.1.2)
21+
actionview (= 8.1.2)
22+
activejob (= 8.1.2)
23+
activesupport (= 8.1.2)
2224
mail (>= 2.8.0)
2325
rails-dom-testing (~> 2.2)
24-
actionpack (8.0.4)
25-
actionview (= 8.0.4)
26-
activesupport (= 8.0.4)
26+
actionpack (8.1.2)
27+
actionview (= 8.1.2)
28+
activesupport (= 8.1.2)
2729
nokogiri (>= 1.8.5)
2830
rack (>= 2.2.4)
2931
rack-session (>= 1.0.1)
3032
rack-test (>= 0.6.3)
3133
rails-dom-testing (~> 2.2)
3234
rails-html-sanitizer (~> 1.6)
3335
useragent (~> 0.16)
34-
actiontext (8.0.4)
35-
actionpack (= 8.0.4)
36-
activerecord (= 8.0.4)
37-
activestorage (= 8.0.4)
38-
activesupport (= 8.0.4)
36+
actiontext (8.1.2)
37+
action_text-trix (~> 2.1.15)
38+
actionpack (= 8.1.2)
39+
activerecord (= 8.1.2)
40+
activestorage (= 8.1.2)
41+
activesupport (= 8.1.2)
3942
globalid (>= 0.6.0)
4043
nokogiri (>= 1.8.5)
41-
actionview (8.0.4)
42-
activesupport (= 8.0.4)
44+
actionview (8.1.2)
45+
activesupport (= 8.1.2)
4346
builder (~> 3.1)
4447
erubi (~> 1.11)
4548
rails-dom-testing (~> 2.2)
4649
rails-html-sanitizer (~> 1.6)
47-
activejob (8.0.4)
48-
activesupport (= 8.0.4)
50+
activejob (8.1.2)
51+
activesupport (= 8.1.2)
4952
globalid (>= 0.3.6)
50-
activemodel (8.0.4)
51-
activesupport (= 8.0.4)
52-
activerecord (8.0.4)
53-
activemodel (= 8.0.4)
54-
activesupport (= 8.0.4)
53+
activemodel (8.1.2)
54+
activesupport (= 8.1.2)
55+
activerecord (8.1.2)
56+
activemodel (= 8.1.2)
57+
activesupport (= 8.1.2)
5558
timeout (>= 0.4.0)
56-
activestorage (8.0.4)
57-
actionpack (= 8.0.4)
58-
activejob (= 8.0.4)
59-
activerecord (= 8.0.4)
60-
activesupport (= 8.0.4)
59+
activestorage (8.1.2)
60+
actionpack (= 8.1.2)
61+
activejob (= 8.1.2)
62+
activerecord (= 8.1.2)
63+
activesupport (= 8.1.2)
6164
marcel (~> 1.0)
62-
activesupport (8.0.4)
65+
activesupport (8.1.2)
6366
base64
64-
benchmark (>= 0.3)
6567
bigdecimal
6668
concurrent-ruby (~> 1.0, >= 1.3.1)
6769
connection_pool (>= 2.2.5)
6870
drb
6971
i18n (>= 1.6, < 2)
72+
json
7073
logger (>= 1.4.2)
7174
minitest (>= 5.1)
7275
securerandom (>= 0.3)
@@ -76,7 +79,6 @@ GEM
7679
public_suffix (>= 2.0.2, < 8.0)
7780
ast (2.4.3)
7881
base64 (0.3.0)
79-
benchmark (0.5.0)
8082
bigdecimal (4.0.1)
8183
builder (3.3.0)
8284
coderay (1.1.3)
@@ -131,7 +133,8 @@ GEM
131133
logger
132134
mini_mime (1.1.5)
133135
mini_portile2 (2.8.9)
134-
minitest (5.27.0)
136+
minitest (6.0.1)
137+
prism (~> 1.5)
135138
net-imap (0.6.2)
136139
date
137140
net-protocol
@@ -199,20 +202,20 @@ GEM
199202
rack (>= 1.3)
200203
rackup (2.3.1)
201204
rack (>= 3)
202-
rails (8.0.4)
203-
actioncable (= 8.0.4)
204-
actionmailbox (= 8.0.4)
205-
actionmailer (= 8.0.4)
206-
actionpack (= 8.0.4)
207-
actiontext (= 8.0.4)
208-
actionview (= 8.0.4)
209-
activejob (= 8.0.4)
210-
activemodel (= 8.0.4)
211-
activerecord (= 8.0.4)
212-
activestorage (= 8.0.4)
213-
activesupport (= 8.0.4)
205+
rails (8.1.2)
206+
actioncable (= 8.1.2)
207+
actionmailbox (= 8.1.2)
208+
actionmailer (= 8.1.2)
209+
actionpack (= 8.1.2)
210+
actiontext (= 8.1.2)
211+
actionview (= 8.1.2)
212+
activejob (= 8.1.2)
213+
activemodel (= 8.1.2)
214+
activerecord (= 8.1.2)
215+
activestorage (= 8.1.2)
216+
activesupport (= 8.1.2)
214217
bundler (>= 1.15.0)
215-
railties (= 8.0.4)
218+
railties (= 8.1.2)
216219
rails-controller-testing (1.0.5)
217220
actionpack (>= 5.0.1.rc1)
218221
actionview (>= 5.0.1.rc1)
@@ -227,9 +230,9 @@ GEM
227230
rails-i18n (8.1.0)
228231
i18n (>= 0.7, < 2)
229232
railties (>= 8.0.0, < 9)
230-
railties (8.0.4)
231-
actionpack (= 8.0.4)
232-
activesupport (= 8.0.4)
233+
railties (8.1.2)
234+
actionpack (= 8.1.2)
235+
activesupport (= 8.1.2)
233236
irb (~> 1.13)
234237
rackup (>= 1.0.0)
235238
rake (>= 12.2)
@@ -332,14 +335,13 @@ DEPENDENCIES
332335
jsbundling-rails (>= 1.3.0)
333336
mini_magick
334337
mini_mime
335-
minitest (< 6)
336338
newrelic_rpm
337339
nokogiri
338340
pg
339341
pry
340342
puma
341343
rack-mini-profiler
342-
rails (~> 8.0.0)
344+
rails (~> 8.1.0)
343345
rails-controller-testing
344346
rails-i18n
345347
rubocop-rails-omakase

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/environments/development.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
# Highlight code that enqueued background job in logs.
5656
config.active_job.verbose_enqueue_logs = true
5757

58+
# Highlight code that triggered redirect in logs.
59+
config.action_dispatch.verbose_redirect_logs = true
60+
5861
# Raises error for missing translations.
5962
# config.i18n.raise_on_missing_translations = true
6063

config/environments/production.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
config.active_storage.service = :local
2626

2727
# Assume all access to the app is happening through a SSL-terminating reverse proxy.
28-
config.assume_ssl = true
28+
# config.assume_ssl = true
2929

3030
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31-
config.force_ssl = true
31+
# config.force_ssl = true
3232

3333
# Skip http-to-https redirect for the default health check endpoint.
3434
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
@@ -37,7 +37,7 @@
3737
config.log_tags = [ :request_id ]
3838
config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
3939

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

4343
# Prevent health checks from clogging up the logs.
@@ -59,7 +59,7 @@
5959
# Set host to be used by links generated in mailer templates.
6060
config.action_mailer.default_url_options = { host: "example.com" }
6161

62-
# Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit.
62+
# Specify outgoing SMTP server. Remember to add smtp/* credentials via bin/rails credentials:edit.
6363
# config.action_mailer.smtp_settings = {
6464
# user_name: Rails.application.credentials.dig(:smtp, :user_name),
6565
# password: Rails.application.credentials.dig(:smtp, :password),

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
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Be sure to restart your server when you modify this file.
2+
#
3+
# This file eases your Rails 8.1 framework defaults upgrade.
4+
#
5+
# Uncomment each configuration one by one to switch to the new default.
6+
# Once your application is ready to run with all new defaults, you can remove
7+
# this file and set the `config.load_defaults` to `8.1`.
8+
#
9+
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
10+
# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html
11+
12+
###
13+
# Skips escaping HTML entities and line separators. When set to `false`, the
14+
# JSON renderer no longer escapes these to improve performance.
15+
#
16+
# Example:
17+
# class PostsController < ApplicationController
18+
# def index
19+
# render json: { key: "\u2028\u2029<>&" }
20+
# end
21+
# end
22+
#
23+
# Renders `{"key":"\u2028\u2029\u003c\u003e\u0026"}` with the previous default, but `{"key":"

<>&"}` with the config
24+
# set to `false`.
25+
#
26+
# Applications that want to keep the escaping behavior can set the config to `true`.
27+
#++
28+
# Rails.configuration.action_controller.escape_json_responses = false
29+
30+
###
31+
# Skips escaping LINE SEPARATOR (U+2028) and PARAGRAPH SEPARATOR (U+2029) in JSON.
32+
#
33+
# Historically these characters were not valid inside JavaScript literal strings but that changed in ECMAScript 2019.
34+
# As such it's no longer a concern in modern browsers: https://caniuse.com/mdn-javascript_builtins_json_json_superset.
35+
#++
36+
# Rails.configuration.active_support.escape_js_separators_in_json = false
37+
38+
###
39+
# Raises an error when order dependent finder methods (e.g. `#first`, `#second`) are called without `order` values
40+
# on the relation, and the model does not have any order columns (`implicit_order_column`, `query_constraints`, or
41+
# `primary_key`) to fall back on.
42+
#
43+
# The current behavior of not raising an error has been deprecated, and this configuration option will be removed in
44+
# Rails 8.2.
45+
#++
46+
# Rails.configuration.active_record.raise_on_missing_required_finder_order_columns = true
47+
48+
###
49+
# Controls how Rails handles path relative URL redirects.
50+
# When set to `:raise`, Rails will raise an `ActionController::Redirecting::UnsafeRedirectError`
51+
# for relative URLs without a leading slash, which can help prevent open redirect vulnerabilities.
52+
#
53+
# Example:
54+
# redirect_to "example.com" # Raises UnsafeRedirectError
55+
# redirect_to "@attacker.com" # Raises UnsafeRedirectError
56+
# redirect_to "/safe/path" # Works correctly
57+
#
58+
# Applications that want to allow these redirects can set the config to `:log` (previous default)
59+
# to only log warnings, or `:notify` to send ActiveSupport notifications.
60+
#++
61+
# Rails.configuration.action_controller.action_on_path_relative_redirect = :raise
62+
63+
###
64+
# Use a Ruby parser to track dependencies between Action View templates
65+
#++
66+
# Rails.configuration.action_view.render_tracker = :ruby
67+
68+
###
69+
# When enabled, hidden inputs generated by `form_tag`, `token_tag`, `method_tag`, and the hidden parameter fields
70+
# included in `button_to` forms will omit the `autocomplete="off"` attribute.
71+
#
72+
# Applications that want to keep generating the `autocomplete` attribute for those tags can set it to `false`.
73+
#++
74+
# Rails.configuration.action_view.remove_hidden_field_autocomplete = true

config/puma.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
#
88
# You can control the number of workers using ENV["WEB_CONCURRENCY"]. You
99
# should only set this value when you want to run 2 or more workers. The
10-
# default is already 1.
10+
# default is already 1. You can set it to `auto` to automatically start a worker
11+
# for each available processor.
1112
#
1213
# The ideal number of threads per worker depends both on how much time the
1314
# application spends waiting for IO operations and on how much you wish to
@@ -33,7 +34,7 @@
3334
# Allow puma to be restarted by `bin/rails restart` command.
3435
plugin :tmp_restart
3536

36-
# Run the Solid Queue supervisor inside of Puma for single-server deployments
37+
# Run the Solid Queue supervisor inside of Puma for single-server deployments.
3738
plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"]
3839

3940
# Specify the PID file. Defaults to tmp/pids/server.pid in development.

0 commit comments

Comments
 (0)