Skip to content

Commit b94245f

Browse files
authored
Rails 7 -> 8.0.5 (#815)
## Status - Closes: Not fully closing - Related to [1291](RaspberryPiFoundation/digital-editor-issues#1291) ## Points for consideration: - Upgrade of syntax to comply with 8.x version ## What's changed? It has been upgraded rails 7 to rails 8.0.4 following the conversations from the Issue above and #784
1 parent bb54448 commit b94245f

15 files changed

Lines changed: 123 additions & 117 deletions

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ gem 'propshaft'
4141
gem 'puma', '~> 8.0'
4242
gem 'rack_content_type_default', '~> 1.1'
4343
gem 'rack-cors'
44-
gem 'rails', '~> 7.2'
44+
gem 'rails', '~> 8.0.5'
4545
gem 'ruby-progressbar', '~> 1.13', require: false
4646
gem 'sentry-rails'
4747
gem 'statesman'

Gemfile.lock

Lines changed: 65 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -11,68 +11,65 @@ GIT
1111
GEM
1212
remote: https://rubygems.org/
1313
specs:
14-
actioncable (7.2.3.1)
15-
actionpack (= 7.2.3.1)
16-
activesupport (= 7.2.3.1)
14+
actioncable (8.0.5)
15+
actionpack (= 8.0.5)
16+
activesupport (= 8.0.5)
1717
nio4r (~> 2.0)
1818
websocket-driver (>= 0.6.1)
1919
zeitwerk (~> 2.6)
20-
actionmailbox (7.2.3.1)
21-
actionpack (= 7.2.3.1)
22-
activejob (= 7.2.3.1)
23-
activerecord (= 7.2.3.1)
24-
activestorage (= 7.2.3.1)
25-
activesupport (= 7.2.3.1)
20+
actionmailbox (8.0.5)
21+
actionpack (= 8.0.5)
22+
activejob (= 8.0.5)
23+
activerecord (= 8.0.5)
24+
activestorage (= 8.0.5)
25+
activesupport (= 8.0.5)
2626
mail (>= 2.8.0)
27-
actionmailer (7.2.3.1)
28-
actionpack (= 7.2.3.1)
29-
actionview (= 7.2.3.1)
30-
activejob (= 7.2.3.1)
31-
activesupport (= 7.2.3.1)
27+
actionmailer (8.0.5)
28+
actionpack (= 8.0.5)
29+
actionview (= 8.0.5)
30+
activejob (= 8.0.5)
31+
activesupport (= 8.0.5)
3232
mail (>= 2.8.0)
3333
rails-dom-testing (~> 2.2)
34-
actionpack (7.2.3.1)
35-
actionview (= 7.2.3.1)
36-
activesupport (= 7.2.3.1)
37-
cgi
34+
actionpack (8.0.5)
35+
actionview (= 8.0.5)
36+
activesupport (= 8.0.5)
3837
nokogiri (>= 1.8.5)
39-
racc
40-
rack (>= 2.2.4, < 3.3)
38+
rack (>= 2.2.4)
4139
rack-session (>= 1.0.1)
4240
rack-test (>= 0.6.3)
4341
rails-dom-testing (~> 2.2)
4442
rails-html-sanitizer (~> 1.6)
4543
useragent (~> 0.16)
46-
actiontext (7.2.3.1)
47-
actionpack (= 7.2.3.1)
48-
activerecord (= 7.2.3.1)
49-
activestorage (= 7.2.3.1)
50-
activesupport (= 7.2.3.1)
44+
actiontext (8.0.5)
45+
actionpack (= 8.0.5)
46+
activerecord (= 8.0.5)
47+
activestorage (= 8.0.5)
48+
activesupport (= 8.0.5)
5149
globalid (>= 0.6.0)
5250
nokogiri (>= 1.8.5)
53-
actionview (7.2.3.1)
54-
activesupport (= 7.2.3.1)
51+
actionview (8.0.5)
52+
activesupport (= 8.0.5)
5553
builder (~> 3.1)
56-
cgi
5754
erubi (~> 1.11)
5855
rails-dom-testing (~> 2.2)
5956
rails-html-sanitizer (~> 1.6)
60-
activejob (7.2.3.1)
61-
activesupport (= 7.2.3.1)
57+
activejob (8.0.5)
58+
activesupport (= 8.0.5)
6259
globalid (>= 0.3.6)
63-
activemodel (7.2.3.1)
64-
activesupport (= 7.2.3.1)
65-
activerecord (7.2.3.1)
66-
activemodel (= 7.2.3.1)
67-
activesupport (= 7.2.3.1)
60+
activemodel (8.0.5)
61+
activesupport (= 8.0.5)
62+
activerecord (8.0.5)
63+
activemodel (= 8.0.5)
64+
activesupport (= 8.0.5)
6865
timeout (>= 0.4.0)
69-
activestorage (7.2.3.1)
70-
actionpack (= 7.2.3.1)
71-
activejob (= 7.2.3.1)
72-
activerecord (= 7.2.3.1)
73-
activesupport (= 7.2.3.1)
66+
activestorage (8.0.5)
67+
actionpack (= 8.0.5)
68+
activejob (= 8.0.5)
69+
activerecord (= 8.0.5)
70+
activesupport (= 8.0.5)
7471
marcel (~> 1.0)
75-
activesupport (7.2.3.1)
72+
activesupport (8.0.5)
7673
base64
7774
benchmark (>= 0.3)
7875
bigdecimal
@@ -81,9 +78,10 @@ GEM
8178
drb
8279
i18n (>= 1.6, < 2)
8380
logger (>= 1.4.2)
84-
minitest (>= 5.1, < 6)
81+
minitest (>= 5.1)
8582
securerandom (>= 0.3)
8683
tzinfo (~> 2.0, >= 2.0.5)
84+
uri (>= 0.13.1)
8785
addressable (2.9.0)
8886
public_suffix (>= 2.0.2, < 8.0)
8987
administrate (1.0.0)
@@ -136,7 +134,6 @@ GEM
136134
rack-test (>= 0.6.3)
137135
regexp_parser (>= 1.5, < 3.0)
138136
xpath (~> 3.2)
139-
cgi (0.5.1)
140137
childprocess (4.1.0)
141138
choice (0.2.0)
142139
climate_control (1.2.0)
@@ -247,7 +244,7 @@ GEM
247244
actionview (>= 7.0.0)
248245
activesupport (>= 7.0.0)
249246
jmespath (1.6.2)
250-
json (2.19.3)
247+
json (2.19.5)
251248
jwt (2.10.2)
252249
base64
253250
kaminari (1.2.2)
@@ -268,24 +265,27 @@ GEM
268265
loofah (2.25.1)
269266
crass (~> 1.0.2)
270267
nokogiri (>= 1.12.0)
271-
mail (2.8.1)
268+
mail (2.9.0)
269+
logger
272270
mini_mime (>= 0.1.1)
273271
net-imap
274272
net-pop
275273
net-smtp
276-
marcel (1.0.4)
274+
marcel (1.1.0)
277275
matrix (0.4.3)
278276
method_source (1.1.0)
279277
mini_magick (5.3.1)
280278
logger
281279
mini_mime (1.1.5)
282-
minitest (5.27.0)
280+
minitest (6.0.6)
281+
drb (~> 2.0)
282+
prism (~> 1.5)
283283
msgpack (1.8.0)
284284
multi_xml (0.8.1)
285285
bigdecimal (>= 3.1, < 5)
286286
net-http (0.9.1)
287287
uri (>= 0.11.1)
288-
net-imap (0.5.9)
288+
net-imap (0.6.4)
289289
date
290290
net-protocol
291291
net-pop (0.1.2)
@@ -379,20 +379,20 @@ GEM
379379
rack
380380
rackup (2.3.1)
381381
rack (>= 3)
382-
rails (7.2.3.1)
383-
actioncable (= 7.2.3.1)
384-
actionmailbox (= 7.2.3.1)
385-
actionmailer (= 7.2.3.1)
386-
actionpack (= 7.2.3.1)
387-
actiontext (= 7.2.3.1)
388-
actionview (= 7.2.3.1)
389-
activejob (= 7.2.3.1)
390-
activemodel (= 7.2.3.1)
391-
activerecord (= 7.2.3.1)
392-
activestorage (= 7.2.3.1)
393-
activesupport (= 7.2.3.1)
382+
rails (8.0.5)
383+
actioncable (= 8.0.5)
384+
actionmailbox (= 8.0.5)
385+
actionmailer (= 8.0.5)
386+
actionpack (= 8.0.5)
387+
actiontext (= 8.0.5)
388+
actionview (= 8.0.5)
389+
activejob (= 8.0.5)
390+
activemodel (= 8.0.5)
391+
activerecord (= 8.0.5)
392+
activestorage (= 8.0.5)
393+
activesupport (= 8.0.5)
394394
bundler (>= 1.15.0)
395-
railties (= 7.2.3.1)
395+
railties (= 8.0.5)
396396
rails-dom-testing (2.3.0)
397397
activesupport (>= 5.0.0)
398398
minitest
@@ -405,10 +405,9 @@ GEM
405405
rails-html-sanitizer (1.7.0)
406406
loofah (~> 2.25)
407407
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)
408-
railties (7.2.3.1)
409-
actionpack (= 7.2.3.1)
410-
activesupport (= 7.2.3.1)
411-
cgi
408+
railties (8.0.5)
409+
actionpack (= 8.0.5)
410+
activesupport (= 8.0.5)
412411
irb (~> 1.13)
413412
rackup (>= 1.0.0)
414413
rake (>= 12.2)
@@ -617,7 +616,7 @@ DEPENDENCIES
617616
puma (~> 8.0)
618617
rack-cors
619618
rack_content_type_default (~> 1.1)
620-
rails (~> 7.2)
619+
rails (~> 8.0.5)
621620
rails-erd
622621
rspec
623622
rspec-rails

app/controllers/api/class_members_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def members_existing_in_profile
8787
end
8888

8989
def class_member_params
90-
params.require(:class_member).permit(:user_id, :type)
90+
params.expect(class_member: %i[user_id type])
9191
end
9292

9393
def create_batch_params

app/controllers/api/google_auth_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ def response_error_message
4646
end
4747

4848
def google_token_params
49-
params.require(:google_auth).require(:code)
50-
params.require(:google_auth).require(:redirect_uri)
51-
params.require(:google_auth).permit(:code, :redirect_uri)
49+
google_auth_params = params.expect(google_auth: %i[code redirect_uri])
50+
google_auth_params.require(%i[code redirect_uri])
51+
google_auth_params
5252
end
5353
end
5454
end

app/controllers/api/projects/remixes_controller.rb

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,19 @@ def load_and_authorize_remix_identifier
6767
end
6868

6969
def remix_params
70-
params.require(:project)
71-
.permit(:name,
72-
:identifier,
73-
:project_type,
74-
:locale,
75-
:user_id,
76-
:videos,
77-
:audio,
78-
:instructions,
79-
image_list: [],
80-
components: %i[id name extension content index])
70+
params
71+
.expect(project: [:name,
72+
:identifier,
73+
:project_type,
74+
:locale,
75+
:user_id,
76+
:videos,
77+
:audio,
78+
:instructions,
79+
{
80+
image_list: [],
81+
components: [%i[id name extension content index]]
82+
}])
8183
end
8284
end
8385
end

app/controllers/api/school_classes_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ def load_and_authorize_school_class
192192

193193
def school_class_params
194194
# A school teacher may only create classes they own.
195-
params.require(:school_class).permit(:name, :description)
195+
params.expect(school_class: %i[name description])
196196
end
197197

198198
def import_school_class_params
199-
params.require(:school_class).permit(:name, :description, :import_origin, :import_id)
199+
params.expect(school_class: %i[name description import_origin import_id])
200200
end
201201

202202
def import_school_students_params

app/controllers/api/school_students_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def remove_students(student_ids)
167167
end
168168

169169
def school_student_params
170-
params.require(:school_student).permit(:username, :password, :name)
170+
params.expect(school_student: %i[username password name])
171171
end
172172

173173
def school_students_params

app/controllers/api/school_teachers_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def create
3030
private
3131

3232
def school_teacher_params
33-
params.require(:school_teacher).permit(:email_address)
33+
params.expect(school_teacher: [:email_address])
3434
end
3535
end
3636
end

app/controllers/api/schools_controller.rb

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -77,26 +77,26 @@ def import
7777
private
7878

7979
def school_params
80-
params.require(:school).permit(
81-
:name,
82-
:website,
83-
:reference,
84-
:district_name,
85-
:district_nces_id,
86-
:school_roll_number,
87-
:address_line_1,
88-
:address_line_2,
89-
:municipality,
90-
:administrative_area,
91-
:postal_code,
92-
:country_code,
93-
:creator_role,
94-
:creator_department,
95-
:creator_agree_authority,
96-
:creator_agree_terms_and_conditions,
97-
:creator_agree_to_ux_contact,
98-
:creator_agree_responsible_safeguarding,
99-
:user_origin
80+
params.expect(
81+
school: %i[name
82+
website
83+
reference
84+
district_name
85+
district_nces_id
86+
school_roll_number
87+
address_line_1
88+
address_line_2
89+
municipality
90+
administrative_area
91+
postal_code
92+
country_code
93+
creator_role
94+
creator_department
95+
creator_agree_authority
96+
creator_agree_terms_and_conditions
97+
creator_agree_to_ux_contact
98+
creator_agree_responsible_safeguarding
99+
user_origin]
100100
)
101101
end
102102
end

app/controllers/api/subscriptions_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def check_cloudflare_turnstile
6363
end
6464

6565
def subscription_params
66-
params.require(:subscription).permit(:email, :test_opt_in, :privacy_policy, :turnstile_token)
66+
params.expect(subscription: %i[email test_opt_in privacy_policy turnstile_token])
6767
end
6868

6969
def subscriptions_submitter

0 commit comments

Comments
 (0)