Skip to content

Commit 7474d9e

Browse files
santir489santib
andauthored
Rails 8 upgrade (#991)
Co-authored-by: Santiago Bartesaghi <santib@hey.com>
1 parent a706ce2 commit 7474d9e

25 files changed

+770
-452
lines changed

.annotaterb.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
:position: before
3+
:position_in_additional_file_patterns: before
4+
:position_in_class: before
5+
:position_in_factory: before
6+
:position_in_fixture: before
7+
:position_in_routes: before
8+
:position_in_serializer: before
9+
:position_in_test: before
10+
:classified_sort: true
11+
:exclude_controllers: true
12+
:exclude_factories: false
13+
:exclude_fixtures: false
14+
:exclude_helpers: true
15+
:exclude_scaffolds: true
16+
:exclude_serializers: false
17+
:exclude_sti_subclasses: false
18+
:exclude_tests: false
19+
:force: false
20+
:format_bare: true
21+
:format_markdown: false
22+
:format_rdoc: false
23+
:format_yard: false
24+
:frozen: false
25+
:ignore_model_sub_dir: false
26+
:ignore_unknown_models: false
27+
:include_version: false
28+
:show_check_constraints: false
29+
:show_complete_foreign_keys: false
30+
:show_foreign_keys: true
31+
:show_indexes: true
32+
:simple_indexes: false
33+
:sort: false
34+
:timestamp: false
35+
:trace: false
36+
:with_comment: true
37+
:with_column_comments: true
38+
:with_table_comments: true
39+
:active_admin: false
40+
:command:
41+
:debug: false
42+
:hide_default_column_types: ''
43+
:hide_limit_column_types: ''
44+
:ignore_columns:
45+
:ignore_routes:
46+
:models: true
47+
:routes: false
48+
:skip_on_db_migrate: false
49+
:target_action: :do_annotations
50+
:wrapper:
51+
:wrapper_close:
52+
:wrapper_open:
53+
:classes_default_to_s: []
54+
:additional_file_patterns: []
55+
:model_dir:
56+
- app/models
57+
:require: []
58+
:root_dir:
59+
- ''

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ jobs:
157157
PARALLEL_TESTS_CONCURRENCY: ${{ env.cpu_cores }}
158158
run: HEADLESS=true bundle exec parallel_rspec -n $PARALLEL_TESTS_CONCURRENCY -e './bin/parallel_tests'
159159
- name: Check for missing annotations
160-
run: bundle exec annotate
160+
run: bundle exec annotaterb models
161161
- name: Check for untracked changes in app and spec directories
162162
uses: rootstrap/check_untracked_changes@v1
163163
with:

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ source 'https://rubygems.org'
44

55
ruby file: '.ruby-version'
66

7-
gem 'rails', '~> 7.2.2'
7+
gem 'rails', '~> 8.0.1'
88

99
# Gems
1010
gem 'activeadmin', '~> 3.2'
@@ -42,7 +42,7 @@ gem 'yaaf', '~> 3.0'
4242
# gem 'image_processing', '~> 1.2'
4343

4444
group :development, :test do
45-
gem 'annotate', '~> 3.2', '>= 3.0.3'
45+
gem 'annotaterb', '~> 4.14.0'
4646
gem 'dotenv-rails', '~> 3.1.6'
4747
gem 'factory_bot_rails', '~> 6.4'
4848
gem 'faker', '~> 3.5'

Gemfile.lock

Lines changed: 67 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
GIT
22
remote: https://github.com/lynndylanhurley/devise_token_auth.git
3-
revision: 812711e4776f2eab2de8a057bd5befc023fb666b
3+
revision: aedef3ca68d4e69bdc4a3e8987fa9d5f45420eec
44
specs:
5-
devise_token_auth (1.2.3)
5+
devise_token_auth (1.2.5)
66
bcrypt (~> 3.0)
77
devise (> 3.5.2, < 5)
8-
rails (>= 4.2.0, < 7.3)
8+
rails (>= 4.2.0, < 8.1)
99

1010
GIT
1111
remote: https://github.com/rootstrap/rspec-retry.git
@@ -18,46 +18,45 @@ GIT
1818
GEM
1919
remote: https://rubygems.org/
2020
specs:
21-
actioncable (7.2.2.1)
22-
actionpack (= 7.2.2.1)
23-
activesupport (= 7.2.2.1)
21+
actioncable (8.0.1)
22+
actionpack (= 8.0.1)
23+
activesupport (= 8.0.1)
2424
nio4r (~> 2.0)
2525
websocket-driver (>= 0.6.1)
2626
zeitwerk (~> 2.6)
27-
actionmailbox (7.2.2.1)
28-
actionpack (= 7.2.2.1)
29-
activejob (= 7.2.2.1)
30-
activerecord (= 7.2.2.1)
31-
activestorage (= 7.2.2.1)
32-
activesupport (= 7.2.2.1)
27+
actionmailbox (8.0.1)
28+
actionpack (= 8.0.1)
29+
activejob (= 8.0.1)
30+
activerecord (= 8.0.1)
31+
activestorage (= 8.0.1)
32+
activesupport (= 8.0.1)
3333
mail (>= 2.8.0)
34-
actionmailer (7.2.2.1)
35-
actionpack (= 7.2.2.1)
36-
actionview (= 7.2.2.1)
37-
activejob (= 7.2.2.1)
38-
activesupport (= 7.2.2.1)
34+
actionmailer (8.0.1)
35+
actionpack (= 8.0.1)
36+
actionview (= 8.0.1)
37+
activejob (= 8.0.1)
38+
activesupport (= 8.0.1)
3939
mail (>= 2.8.0)
4040
rails-dom-testing (~> 2.2)
41-
actionpack (7.2.2.1)
42-
actionview (= 7.2.2.1)
43-
activesupport (= 7.2.2.1)
41+
actionpack (8.0.1)
42+
actionview (= 8.0.1)
43+
activesupport (= 8.0.1)
4444
nokogiri (>= 1.8.5)
45-
racc
46-
rack (>= 2.2.4, < 3.2)
45+
rack (>= 2.2.4)
4746
rack-session (>= 1.0.1)
4847
rack-test (>= 0.6.3)
4948
rails-dom-testing (~> 2.2)
5049
rails-html-sanitizer (~> 1.6)
5150
useragent (~> 0.16)
52-
actiontext (7.2.2.1)
53-
actionpack (= 7.2.2.1)
54-
activerecord (= 7.2.2.1)
55-
activestorage (= 7.2.2.1)
56-
activesupport (= 7.2.2.1)
51+
actiontext (8.0.1)
52+
actionpack (= 8.0.1)
53+
activerecord (= 8.0.1)
54+
activestorage (= 8.0.1)
55+
activesupport (= 8.0.1)
5756
globalid (>= 0.6.0)
5857
nokogiri (>= 1.8.5)
59-
actionview (7.2.2.1)
60-
activesupport (= 7.2.2.1)
58+
actionview (8.0.1)
59+
activesupport (= 8.0.1)
6160
builder (~> 3.1)
6261
erubi (~> 1.11)
6362
rails-dom-testing (~> 2.2)
@@ -75,26 +74,26 @@ GEM
7574
kaminari (>= 1.2.1)
7675
railties (>= 6.1)
7776
ransack (>= 4.0)
78-
activejob (7.2.2.1)
79-
activesupport (= 7.2.2.1)
77+
activejob (8.0.1)
78+
activesupport (= 8.0.1)
8079
globalid (>= 0.3.6)
81-
activemodel (7.2.2.1)
82-
activesupport (= 7.2.2.1)
80+
activemodel (8.0.1)
81+
activesupport (= 8.0.1)
8382
activemodel-serializers-xml (1.0.3)
8483
activemodel (>= 5.0.0.a)
8584
activesupport (>= 5.0.0.a)
8685
builder (~> 3.1)
87-
activerecord (7.2.2.1)
88-
activemodel (= 7.2.2.1)
89-
activesupport (= 7.2.2.1)
86+
activerecord (8.0.1)
87+
activemodel (= 8.0.1)
88+
activesupport (= 8.0.1)
9089
timeout (>= 0.4.0)
91-
activestorage (7.2.2.1)
92-
actionpack (= 7.2.2.1)
93-
activejob (= 7.2.2.1)
94-
activerecord (= 7.2.2.1)
95-
activesupport (= 7.2.2.1)
90+
activestorage (8.0.1)
91+
actionpack (= 8.0.1)
92+
activejob (= 8.0.1)
93+
activerecord (= 8.0.1)
94+
activesupport (= 8.0.1)
9695
marcel (~> 1.0)
97-
activesupport (7.2.2.1)
96+
activesupport (8.0.1)
9897
base64
9998
benchmark (>= 0.3)
10099
bigdecimal
@@ -106,11 +105,10 @@ GEM
106105
minitest (>= 5.1)
107106
securerandom (>= 0.3)
108107
tzinfo (~> 2.0, >= 2.0.5)
108+
uri (>= 0.13.1)
109109
addressable (2.8.7)
110110
public_suffix (>= 2.0.2, < 7.0)
111-
annotate (3.2.0)
112-
activerecord (>= 3.2, < 8.0)
113-
rake (>= 10.4, < 14.0)
111+
annotaterb (4.14.0)
114112
arbre (1.7.0)
115113
activesupport (>= 3.0.0)
116114
ruby2_keywords (>= 0.0.2)
@@ -358,7 +356,7 @@ GEM
358356
net-protocol
359357
net-protocol (0.2.2)
360358
timeout
361-
net-smtp (0.5.0)
359+
net-smtp (0.5.1)
362360
net-protocol
363361
newrelic_rpm (9.17.0)
364362
nio4r (2.7.4)
@@ -418,30 +416,30 @@ GEM
418416
rack (>= 1.3)
419417
rackup (2.2.1)
420418
rack (>= 3)
421-
rails (7.2.2.1)
422-
actioncable (= 7.2.2.1)
423-
actionmailbox (= 7.2.2.1)
424-
actionmailer (= 7.2.2.1)
425-
actionpack (= 7.2.2.1)
426-
actiontext (= 7.2.2.1)
427-
actionview (= 7.2.2.1)
428-
activejob (= 7.2.2.1)
429-
activemodel (= 7.2.2.1)
430-
activerecord (= 7.2.2.1)
431-
activestorage (= 7.2.2.1)
432-
activesupport (= 7.2.2.1)
419+
rails (8.0.1)
420+
actioncable (= 8.0.1)
421+
actionmailbox (= 8.0.1)
422+
actionmailer (= 8.0.1)
423+
actionpack (= 8.0.1)
424+
actiontext (= 8.0.1)
425+
actionview (= 8.0.1)
426+
activejob (= 8.0.1)
427+
activemodel (= 8.0.1)
428+
activerecord (= 8.0.1)
429+
activestorage (= 8.0.1)
430+
activesupport (= 8.0.1)
433431
bundler (>= 1.15.0)
434-
railties (= 7.2.2.1)
432+
railties (= 8.0.1)
435433
rails-dom-testing (2.2.0)
436434
activesupport (>= 5.0.0)
437435
minitest
438436
nokogiri (>= 1.6)
439437
rails-html-sanitizer (1.6.2)
440438
loofah (~> 2.21)
441439
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)
442-
rails-i18n (7.0.10)
440+
rails-i18n (8.0.1)
443441
i18n (>= 0.7, < 2)
444-
railties (>= 6.0.0, < 8)
442+
railties (>= 8.0.0, < 9)
445443
rails_best_practices (1.23.2)
446444
activesupport
447445
code_analyzer (~> 0.5.5)
@@ -450,9 +448,9 @@ GEM
450448
json
451449
require_all (~> 3.0)
452450
ruby-progressbar
453-
railties (7.2.2.1)
454-
actionpack (= 7.2.2.1)
455-
activesupport (= 7.2.2.1)
451+
railties (8.0.1)
452+
actionpack (= 8.0.1)
453+
activesupport (= 8.0.1)
456454
irb (~> 1.13)
457455
rackup (>= 1.0.0)
458456
rake (>= 12.2)
@@ -593,7 +591,7 @@ GEM
593591
tzinfo (2.0.6)
594592
concurrent-ruby (~> 1.0)
595593
unicode-display_width (2.6.0)
596-
uri (0.13.1)
594+
uri (1.0.3)
597595
useragent (0.16.11)
598596
warden (1.2.9)
599597
rack (>= 2.0.9)
@@ -602,7 +600,8 @@ GEM
602600
crack (>= 0.3.2)
603601
hashdiff (>= 0.4.0, < 2.0.0)
604602
websocket (1.2.11)
605-
websocket-driver (0.7.6)
603+
websocket-driver (0.7.7)
604+
base64
606605
websocket-extensions (>= 0.1.0)
607606
websocket-extensions (0.1.5)
608607
xpath (3.2.0)
@@ -621,7 +620,7 @@ PLATFORMS
621620
DEPENDENCIES
622621
active_storage_base64 (~> 3.0.0)
623622
activeadmin (~> 3.2)
624-
annotate (~> 3.2, >= 3.0.3)
623+
annotaterb (~> 4.14.0)
625624
aws-sdk-s3 (~> 1.182)
626625
better_errors (~> 2.10)
627626
binding_of_caller (~> 1.0)
@@ -659,7 +658,7 @@ DEPENDENCIES
659658
puma (~> 6.6)
660659
pundit (~> 2.4)
661660
rack-cors (~> 2.0)
662-
rails (~> 7.2.2)
661+
rails (~> 8.0.1)
663662
rails_best_practices (~> 1.20)
664663
reek (~> 6.4)
665664
rspec-openapi (~> 0.18)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Code Climate](https://codeclimate.com/github/rootstrap/rails_api_base/badges/gpa.svg)](https://codeclimate.com/github/rootstrap/rails_api_base)
55
[![Test Coverage](https://api.codeclimate.com/v1/badges/63de7f82c79f5fe82f46/test_coverage)](https://codeclimate.com/github/rootstrap/rails_api_base/test_coverage)
66

7-
Rails API Base is a boilerplate project for JSON RESTful APIs. It follows the community best practices in terms of standards, security and maintainability, integrating a variety of testing and code quality tools. It's based on Rails 7.2 and Ruby 3.3.
7+
Rails API Base is a boilerplate project for JSON RESTful APIs. It follows the community best practices in terms of standards, security and maintainability, integrating a variety of testing and code quality tools. It's based on Rails 8.0 and Ruby 3.4.
88

99
Finally, it contains a plug an play Administration console (thanks to [ActiveAdmin](https://github.com/activeadmin/activeadmin)).
1010

@@ -73,7 +73,7 @@ To illustrate, `bin/rails console` will run the console in the docker container
7373

7474
- [ActiveAdmin](https://github.com/activeadmin/activeadmin) for easy administration
7575
- [Arctic Admin](https://github.com/cprodhomme/arctic_admin) for responsive active admin
76-
- [Annotate](https://github.com/ctran/annotate_models) for documenting the schema in the classes
76+
- [Annotaterb](https://github.com/drwl/annotaterb) for documenting the schema in the classes
7777
- [Better Errors](https://github.com/charliesome/better_errors) for a better error page
7878
- [Brakeman](https://github.com/presidentbeef/brakeman) for security static analysis
7979
- [Byebug](https://github.com/deivid-rodriguez/byebug) for debugging

app/controllers/api/v1/registrations_controller.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ class RegistrationsController < DeviseTokenAuth::RegistrationsController
99
private
1010

1111
def sign_up_params
12-
params.require(:user).permit(:email, :password, :password_confirmation,
13-
:username, :first_name, :last_name)
12+
params.expect(user: %i[email password password_confirmation username first_name last_name])
1413
end
1514

1615
def render_create_success

app/controllers/api/v1/sessions_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class SessionsController < DeviseTokenAuth::SessionsController
99
private
1010

1111
def resource_params
12-
params.require(:user).permit(:email, :password)
12+
params.expect(user: %i[email password])
1313
end
1414

1515
def render_create_success

app/controllers/api/v1/users_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def update
1616
private
1717

1818
def update_user_params
19-
params.require(:user).permit(:username, :first_name, :last_name, :email)
19+
params.expect(user: %i[username first_name last_name email])
2020
end
2121
end
2222
end

0 commit comments

Comments
 (0)