Skip to content

Commit ff7e849

Browse files
committed
Upgrade to Rails 8.0 and adopt new features
- Bump Rails to version 8.0 and execute `rails app:update` for configuration alignment - Recommend Node.js 22 for development and runtime compatibility - Enhance Dependabot configuration for improved dependency management - Remove suppression of SQLite production warning, addressing rails/rails#50463 - Use an example domain for email addresses in test suites - Reorder certain path assertions after text assertions in specs to ensure server state is persisted - Add the frozen string literal magic comment to Ruby files - Switch to Rails 8’s built-in rate limiter for request throttling Closes #637
1 parent f86606d commit ff7e849

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+821
-468
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ updates:
1717
bundler:
1818
patterns:
1919
- "*"
20-
ignore:
21-
- dependency-name: sqlite3
22-
versions: ">= 2" # FIXME: Remove when rails/rails#51636 will be released
2320
- package-ecosystem: npm
2421
directory: /
2522
schedule:
@@ -29,3 +26,6 @@ updates:
2926
npm:
3027
patterns:
3128
- "*"
29+
ignore:
30+
- dependency-name: "tailwindcss"
31+
versions: ">= 4.0"

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
# frozen_string_literal: true
2+
13
source "https://rubygems.org"
24

35
ruby "3.4.3"
46

5-
gem "rails", "~> 7.2.0"
7+
gem "rails", "~> 8.0.2"
68
gem "sqlite3"
79
gem "puma"
810

Gemfile.lock

Lines changed: 77 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,45 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (7.2.2.1)
5-
actionpack (= 7.2.2.1)
6-
activesupport (= 7.2.2.1)
4+
actioncable (8.0.2)
5+
actionpack (= 8.0.2)
6+
activesupport (= 8.0.2)
77
nio4r (~> 2.0)
88
websocket-driver (>= 0.6.1)
99
zeitwerk (~> 2.6)
10-
actionmailbox (7.2.2.1)
11-
actionpack (= 7.2.2.1)
12-
activejob (= 7.2.2.1)
13-
activerecord (= 7.2.2.1)
14-
activestorage (= 7.2.2.1)
15-
activesupport (= 7.2.2.1)
10+
actionmailbox (8.0.2)
11+
actionpack (= 8.0.2)
12+
activejob (= 8.0.2)
13+
activerecord (= 8.0.2)
14+
activestorage (= 8.0.2)
15+
activesupport (= 8.0.2)
1616
mail (>= 2.8.0)
17-
actionmailer (7.2.2.1)
18-
actionpack (= 7.2.2.1)
19-
actionview (= 7.2.2.1)
20-
activejob (= 7.2.2.1)
21-
activesupport (= 7.2.2.1)
17+
actionmailer (8.0.2)
18+
actionpack (= 8.0.2)
19+
actionview (= 8.0.2)
20+
activejob (= 8.0.2)
21+
activesupport (= 8.0.2)
2222
mail (>= 2.8.0)
2323
rails-dom-testing (~> 2.2)
24-
actionpack (7.2.2.1)
25-
actionview (= 7.2.2.1)
26-
activesupport (= 7.2.2.1)
24+
actionpack (8.0.2)
25+
actionview (= 8.0.2)
26+
activesupport (= 8.0.2)
2727
nokogiri (>= 1.8.5)
28-
racc
29-
rack (>= 2.2.4, < 3.2)
28+
rack (>= 2.2.4)
3029
rack-session (>= 1.0.1)
3130
rack-test (>= 0.6.3)
3231
rails-dom-testing (~> 2.2)
3332
rails-html-sanitizer (~> 1.6)
3433
useragent (~> 0.16)
35-
actiontext (7.2.2.1)
36-
actionpack (= 7.2.2.1)
37-
activerecord (= 7.2.2.1)
38-
activestorage (= 7.2.2.1)
39-
activesupport (= 7.2.2.1)
34+
actiontext (8.0.2)
35+
actionpack (= 8.0.2)
36+
activerecord (= 8.0.2)
37+
activestorage (= 8.0.2)
38+
activesupport (= 8.0.2)
4039
globalid (>= 0.6.0)
4140
nokogiri (>= 1.8.5)
42-
actionview (7.2.2.1)
43-
activesupport (= 7.2.2.1)
41+
actionview (8.0.2)
42+
activesupport (= 8.0.2)
4443
builder (~> 3.1)
4544
erubi (~> 1.11)
4645
rails-dom-testing (~> 2.2)
@@ -54,22 +53,22 @@ GEM
5453
kaminari (>= 1.2.1)
5554
railties (>= 7.0)
5655
ransack (>= 4.0)
57-
activejob (7.2.2.1)
58-
activesupport (= 7.2.2.1)
56+
activejob (8.0.2)
57+
activesupport (= 8.0.2)
5958
globalid (>= 0.3.6)
60-
activemodel (7.2.2.1)
61-
activesupport (= 7.2.2.1)
62-
activerecord (7.2.2.1)
63-
activemodel (= 7.2.2.1)
64-
activesupport (= 7.2.2.1)
59+
activemodel (8.0.2)
60+
activesupport (= 8.0.2)
61+
activerecord (8.0.2)
62+
activemodel (= 8.0.2)
63+
activesupport (= 8.0.2)
6564
timeout (>= 0.4.0)
66-
activestorage (7.2.2.1)
67-
actionpack (= 7.2.2.1)
68-
activejob (= 7.2.2.1)
69-
activerecord (= 7.2.2.1)
70-
activesupport (= 7.2.2.1)
65+
activestorage (8.0.2)
66+
actionpack (= 8.0.2)
67+
activejob (= 8.0.2)
68+
activerecord (= 8.0.2)
69+
activesupport (= 8.0.2)
7170
marcel (~> 1.0)
72-
activesupport (7.2.2.1)
71+
activesupport (8.0.2)
7372
base64
7473
benchmark (>= 0.3)
7574
bigdecimal
@@ -81,14 +80,15 @@ GEM
8180
minitest (>= 5.1)
8281
securerandom (>= 0.3)
8382
tzinfo (~> 2.0, >= 2.0.5)
83+
uri (>= 0.13.1)
8484
addressable (2.8.7)
8585
public_suffix (>= 2.0.2, < 7.0)
8686
arbre (2.2.0)
8787
activesupport (>= 7.0)
88-
base64 (0.2.0)
88+
base64 (0.3.0)
8989
bcrypt (3.1.20)
90-
benchmark (0.4.0)
91-
bigdecimal (3.1.9)
90+
benchmark (0.4.1)
91+
bigdecimal (3.2.1)
9292
builder (3.3.0)
9393
capybara (3.40.0)
9494
addressable
@@ -104,7 +104,7 @@ GEM
104104
crass (1.0.6)
105105
cssbundling-rails (1.4.3)
106106
railties (>= 6.0.0)
107-
csv (3.3.4)
107+
csv (3.3.5)
108108
date (3.4.1)
109109
debug (1.10.0)
110110
irb (~> 1.10)
@@ -116,7 +116,8 @@ GEM
116116
responders
117117
warden (~> 1.2.3)
118118
docile (1.4.1)
119-
drb (2.2.1)
119+
drb (2.2.3)
120+
erb (5.0.1)
120121
erubi (1.13.1)
121122
formtastic (5.0.0)
122123
actionpack (>= 6.0.0)
@@ -155,7 +156,7 @@ GEM
155156
kaminari-core (= 1.2.2)
156157
kaminari-core (1.2.2)
157158
logger (1.7.0)
158-
loofah (2.24.0)
159+
loofah (2.24.1)
159160
crass (~> 1.0.2)
160161
nokogiri (>= 1.12.0)
161162
mail (2.8.1)
@@ -166,9 +167,9 @@ GEM
166167
marcel (1.0.4)
167168
matrix (0.4.2)
168169
mini_mime (1.1.5)
169-
mini_portile2 (2.8.8)
170+
mini_portile2 (2.8.9)
170171
minitest (5.25.5)
171-
net-imap (0.5.7)
172+
net-imap (0.5.8)
172173
date
173174
net-protocol
174175
net-pop (0.1.2)
@@ -189,56 +190,57 @@ GEM
189190
pp (0.6.2)
190191
prettyprint
191192
prettyprint (0.2.0)
192-
psych (5.2.3)
193+
psych (5.2.6)
193194
date
194195
stringio
195-
public_suffix (6.0.1)
196+
public_suffix (6.0.2)
196197
puma (6.6.0)
197198
nio4r (~> 2.0)
198199
racc (1.8.1)
199-
rack (3.1.14)
200+
rack (3.1.15)
200201
rack-session (2.1.1)
201202
base64 (>= 0.1.0)
202203
rack (>= 3.0.0)
203204
rack-test (2.2.0)
204205
rack (>= 1.3)
205206
rackup (2.2.1)
206207
rack (>= 3)
207-
rails (7.2.2.1)
208-
actioncable (= 7.2.2.1)
209-
actionmailbox (= 7.2.2.1)
210-
actionmailer (= 7.2.2.1)
211-
actionpack (= 7.2.2.1)
212-
actiontext (= 7.2.2.1)
213-
actionview (= 7.2.2.1)
214-
activejob (= 7.2.2.1)
215-
activemodel (= 7.2.2.1)
216-
activerecord (= 7.2.2.1)
217-
activestorage (= 7.2.2.1)
218-
activesupport (= 7.2.2.1)
208+
rails (8.0.2)
209+
actioncable (= 8.0.2)
210+
actionmailbox (= 8.0.2)
211+
actionmailer (= 8.0.2)
212+
actionpack (= 8.0.2)
213+
actiontext (= 8.0.2)
214+
actionview (= 8.0.2)
215+
activejob (= 8.0.2)
216+
activemodel (= 8.0.2)
217+
activerecord (= 8.0.2)
218+
activestorage (= 8.0.2)
219+
activesupport (= 8.0.2)
219220
bundler (>= 1.15.0)
220-
railties (= 7.2.2.1)
221-
rails-dom-testing (2.2.0)
221+
railties (= 8.0.2)
222+
rails-dom-testing (2.3.0)
222223
activesupport (>= 5.0.0)
223224
minitest
224225
nokogiri (>= 1.6)
225226
rails-html-sanitizer (1.6.2)
226227
loofah (~> 2.21)
227228
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)
228-
railties (7.2.2.1)
229-
actionpack (= 7.2.2.1)
230-
activesupport (= 7.2.2.1)
229+
railties (8.0.2)
230+
actionpack (= 8.0.2)
231+
activesupport (= 8.0.2)
231232
irb (~> 1.13)
232233
rackup (>= 1.0.0)
233234
rake (>= 12.2)
234235
thor (~> 1.0, >= 1.2.2)
235236
zeitwerk (~> 2.6)
236-
rake (13.2.1)
237+
rake (13.3.0)
237238
ransack (4.3.0)
238239
activerecord (>= 6.1.5)
239240
activesupport (>= 6.1.5)
240241
i18n
241-
rdoc (6.13.1)
242+
rdoc (6.14.0)
243+
erb
242244
psych (>= 4.0.0)
243245
regexp_parser (2.10.0)
244246
reline (0.6.1)
@@ -249,7 +251,7 @@ GEM
249251
rexml (3.4.1)
250252
rubyzip (2.4.1)
251253
securerandom (0.4.1)
252-
selenium-webdriver (4.31.0)
254+
selenium-webdriver (4.33.0)
253255
base64 (~> 0.2)
254256
logger (~> 1.4)
255257
rexml (~> 3.2, >= 3.2.5)
@@ -281,17 +283,18 @@ GEM
281283
timeout (0.4.3)
282284
tzinfo (2.0.6)
283285
concurrent-ruby (~> 1.0)
286+
uri (1.0.3)
284287
useragent (0.16.11)
285288
warden (1.2.9)
286289
rack (>= 2.0.9)
287290
websocket (1.2.11)
288-
websocket-driver (0.7.7)
291+
websocket-driver (0.8.0)
289292
base64
290293
websocket-extensions (>= 0.1.0)
291294
websocket-extensions (0.1.5)
292295
xpath (3.2.0)
293296
nokogiri (~> 1.8)
294-
zeitwerk (2.7.2)
297+
zeitwerk (2.7.3)
295298

296299
PLATFORMS
297300
arm64-darwin-22
@@ -307,7 +310,7 @@ DEPENDENCIES
307310
devise
308311
importmap-rails
309312
puma
310-
rails (~> 7.2.0)
313+
rails (~> 8.0.2)
311314
selenium-webdriver
312315
simplecov
313316
simplecov-cobertura
@@ -319,4 +322,4 @@ RUBY VERSION
319322
ruby 3.4.3p32
320323

321324
BUNDLED WITH
322-
2.6.8
325+
2.6.9

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ https://activeadmin-demo.onrender.com
88

99
- Clone this repository
1010
- Install Ruby 3 with [rbenv](https://github.com/rbenv/rbenv)
11-
- Install Node 20 with [nodenv](https://github.com/nodenv/nodenv)
11+
- Install Node 22 with [nodenv](https://github.com/nodenv/nodenv)
1212
- `corepack enable`
1313
- `bundle install`
1414
- `yarn install`

Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Add your own tasks in files placed in lib/tasks ending in .rake,
24
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
35

app/admin/admin_users.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
ActiveAdmin.register AdminUser do
24
menu parent: "Administrative"
35

app/admin/dashboard.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# frozen_string_literal: true
2+
23
ActiveAdmin.register_page "Dashboard" do
34
menu priority: 1, label: proc { I18n.t("active_admin.dashboard") }
45

app/controllers/application_controller.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
# frozen_string_literal: true
2+
13
class ApplicationController < ActionController::Base
24
protect_from_forgery with: :exception
35

6+
rate_limit to: 60, within: 1.minute
7+
rate_limit to: 1000, within: 1.day
8+
49
def route_not_found
510
render file: Rails.public_path.join("404.html"), status: :not_found, layout: false
611
end

app/helpers/application_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
# frozen_string_literal: true
2+
13
module ApplicationHelper
24
end

app/jobs/application_job.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ApplicationJob < ActiveJob::Base
24
# Automatically retry jobs that encountered a deadlock
35
# retry_on ActiveRecord::Deadlocked

app/models/admin_user.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class AdminUser < ApplicationRecord
24
DEFAULT_EMAIL = "[email protected]"
35

app/models/application_record.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ApplicationRecord < ActiveRecord::Base
24
primary_abstract_class
35

bin/brakeman

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
24
require "rubygems"
35
require "bundler/setup"
46

0 commit comments

Comments
 (0)