Skip to content

Commit d67b0b5

Browse files
authored
Merge pull request #2250 from olleolleolle/rails71
Upgrade Rails to 7.1
2 parents 0fb4223 + d965ba2 commit d67b0b5

36 files changed

+538
-424
lines changed

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
source 'https://rubygems.org'
22
ruby '3.4.4'
33

4-
gem 'rails', '7.0.8.1'
4+
gem 'rails', '~> 7.1.5.1' # LOCKED: It is Rails.
55
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
66
gem 'sprockets-rails'
77

@@ -10,7 +10,7 @@ gem 'benchmark' # LOCKED: Added because of activesupport 7.0
1010
gem 'bigdecimal' # LOCKED: Added because of activesupport 7.0
1111
gem 'carrierwave'
1212
gem 'cocoon'
13-
gem "csv" # LOCKED: csv was loaded from the standard library, but is not part of the default gems starting from Ruby 3.4.0. Due to config/application.rb
13+
gem 'csv' # LOCKED: csv was loaded from the standard library, but is not part of the default gems starting from Ruby 3.4.0. Due to config/application.rb
1414
gem 'delayed_job'
1515
gem 'delayed_job_active_record'
1616
gem 'drb' # LOCKED: Added because of pry-remote
@@ -119,4 +119,4 @@ end
119119
gem 'rollbar'
120120
gem 'scout_apm'
121121

122-
gem "carrierwave-aws", "~> 1.6"
122+
gem 'carrierwave-aws', '~> 1.6'

Gemfile.lock

Lines changed: 95 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,85 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (7.0.8.1)
5-
actionpack (= 7.0.8.1)
6-
activesupport (= 7.0.8.1)
4+
actioncable (7.1.5.1)
5+
actionpack (= 7.1.5.1)
6+
activesupport (= 7.1.5.1)
77
nio4r (~> 2.0)
88
websocket-driver (>= 0.6.1)
9-
actionmailbox (7.0.8.1)
10-
actionpack (= 7.0.8.1)
11-
activejob (= 7.0.8.1)
12-
activerecord (= 7.0.8.1)
13-
activestorage (= 7.0.8.1)
14-
activesupport (= 7.0.8.1)
9+
zeitwerk (~> 2.6)
10+
actionmailbox (7.1.5.1)
11+
actionpack (= 7.1.5.1)
12+
activejob (= 7.1.5.1)
13+
activerecord (= 7.1.5.1)
14+
activestorage (= 7.1.5.1)
15+
activesupport (= 7.1.5.1)
1516
mail (>= 2.7.1)
1617
net-imap
1718
net-pop
1819
net-smtp
19-
actionmailer (7.0.8.1)
20-
actionpack (= 7.0.8.1)
21-
actionview (= 7.0.8.1)
22-
activejob (= 7.0.8.1)
23-
activesupport (= 7.0.8.1)
20+
actionmailer (7.1.5.1)
21+
actionpack (= 7.1.5.1)
22+
actionview (= 7.1.5.1)
23+
activejob (= 7.1.5.1)
24+
activesupport (= 7.1.5.1)
2425
mail (~> 2.5, >= 2.5.4)
2526
net-imap
2627
net-pop
2728
net-smtp
28-
rails-dom-testing (~> 2.0)
29-
actionpack (7.0.8.1)
30-
actionview (= 7.0.8.1)
31-
activesupport (= 7.0.8.1)
32-
rack (~> 2.0, >= 2.2.4)
29+
rails-dom-testing (~> 2.2)
30+
actionpack (7.1.5.1)
31+
actionview (= 7.1.5.1)
32+
activesupport (= 7.1.5.1)
33+
nokogiri (>= 1.8.5)
34+
racc
35+
rack (>= 2.2.4)
36+
rack-session (>= 1.0.1)
3337
rack-test (>= 0.6.3)
34-
rails-dom-testing (~> 2.0)
35-
rails-html-sanitizer (~> 1.0, >= 1.2.0)
36-
actiontext (7.0.8.1)
37-
actionpack (= 7.0.8.1)
38-
activerecord (= 7.0.8.1)
39-
activestorage (= 7.0.8.1)
40-
activesupport (= 7.0.8.1)
38+
rails-dom-testing (~> 2.2)
39+
rails-html-sanitizer (~> 1.6)
40+
actiontext (7.1.5.1)
41+
actionpack (= 7.1.5.1)
42+
activerecord (= 7.1.5.1)
43+
activestorage (= 7.1.5.1)
44+
activesupport (= 7.1.5.1)
4145
globalid (>= 0.6.0)
4246
nokogiri (>= 1.8.5)
43-
actionview (7.0.8.1)
44-
activesupport (= 7.0.8.1)
47+
actionview (7.1.5.1)
48+
activesupport (= 7.1.5.1)
4549
builder (~> 3.1)
46-
erubi (~> 1.4)
47-
rails-dom-testing (~> 2.0)
48-
rails-html-sanitizer (~> 1.1, >= 1.2.0)
49-
activejob (7.0.8.1)
50-
activesupport (= 7.0.8.1)
50+
erubi (~> 1.11)
51+
rails-dom-testing (~> 2.2)
52+
rails-html-sanitizer (~> 1.6)
53+
activejob (7.1.5.1)
54+
activesupport (= 7.1.5.1)
5155
globalid (>= 0.3.6)
52-
activemodel (7.0.8.1)
53-
activesupport (= 7.0.8.1)
54-
activerecord (7.0.8.1)
55-
activemodel (= 7.0.8.1)
56-
activesupport (= 7.0.8.1)
57-
activestorage (7.0.8.1)
58-
actionpack (= 7.0.8.1)
59-
activejob (= 7.0.8.1)
60-
activerecord (= 7.0.8.1)
61-
activesupport (= 7.0.8.1)
56+
activemodel (7.1.5.1)
57+
activesupport (= 7.1.5.1)
58+
activerecord (7.1.5.1)
59+
activemodel (= 7.1.5.1)
60+
activesupport (= 7.1.5.1)
61+
timeout (>= 0.4.0)
62+
activestorage (7.1.5.1)
63+
actionpack (= 7.1.5.1)
64+
activejob (= 7.1.5.1)
65+
activerecord (= 7.1.5.1)
66+
activesupport (= 7.1.5.1)
6267
marcel (~> 1.0)
63-
mini_mime (>= 1.1.0)
64-
activesupport (7.0.8.1)
68+
activesupport (7.1.5.1)
69+
base64
70+
benchmark (>= 0.3)
71+
bigdecimal
6572
concurrent-ruby (~> 1.0, >= 1.0.2)
73+
connection_pool (>= 2.2.5)
74+
drb
6675
i18n (>= 1.6, < 2)
76+
logger (>= 1.4.2)
6777
minitest (>= 5.1)
78+
mutex_m
79+
securerandom (>= 0.3)
6880
tzinfo (~> 2.0)
69-
acts-as-taggable-on (11.0.0)
70-
activerecord (>= 7.0, < 8.0)
81+
acts-as-taggable-on (12.0.0)
82+
activerecord (>= 7.1, < 8.1)
7183
zeitwerk (>= 2.4, < 3.0)
7284
addressable (2.8.7)
7385
public_suffix (>= 2.0.2, < 7.0)
@@ -144,6 +156,7 @@ GEM
144156
commonmarker (2.3.2)
145157
rb_sys (~> 0.9)
146158
concurrent-ruby (1.3.5)
159+
connection_pool (2.5.3)
147160
crass (1.0.6)
148161
css_parser (1.14.0)
149162
addressable
@@ -261,14 +274,14 @@ GEM
261274
mutex_m (0.3.0)
262275
net-http (0.6.0)
263276
uri
264-
net-imap (0.4.20)
277+
net-imap (0.5.9)
265278
date
266279
net-protocol
267280
net-pop (0.1.2)
268281
net-protocol
269282
net-protocol (0.2.2)
270283
timeout
271-
net-smtp (0.4.0.1)
284+
net-smtp (0.5.1)
272285
net-protocol
273286
nio4r (2.7.4)
274287
nokogiri (1.18.9)
@@ -341,28 +354,34 @@ GEM
341354
pundit (2.5.0)
342355
activesupport (>= 3.0.0)
343356
racc (1.8.1)
344-
rack (2.2.17)
357+
rack (3.2.0)
345358
rack-mini-profiler (4.0.1)
346359
rack (>= 1.2.0)
347-
rack-protection (3.2.0)
360+
rack-protection (4.1.1)
348361
base64 (>= 0.1.0)
349-
rack (~> 2.2, >= 2.2.4)
362+
logger (>= 1.6.0)
363+
rack (>= 3.0.0, < 4)
364+
rack-session (2.1.1)
365+
base64 (>= 0.1.0)
366+
rack (>= 3.0.0)
350367
rack-test (2.2.0)
351368
rack (>= 1.3)
352-
rails (7.0.8.1)
353-
actioncable (= 7.0.8.1)
354-
actionmailbox (= 7.0.8.1)
355-
actionmailer (= 7.0.8.1)
356-
actionpack (= 7.0.8.1)
357-
actiontext (= 7.0.8.1)
358-
actionview (= 7.0.8.1)
359-
activejob (= 7.0.8.1)
360-
activemodel (= 7.0.8.1)
361-
activerecord (= 7.0.8.1)
362-
activestorage (= 7.0.8.1)
363-
activesupport (= 7.0.8.1)
369+
rackup (2.2.1)
370+
rack (>= 3)
371+
rails (7.1.5.1)
372+
actioncable (= 7.1.5.1)
373+
actionmailbox (= 7.1.5.1)
374+
actionmailer (= 7.1.5.1)
375+
actionpack (= 7.1.5.1)
376+
actiontext (= 7.1.5.1)
377+
actionview (= 7.1.5.1)
378+
activejob (= 7.1.5.1)
379+
activemodel (= 7.1.5.1)
380+
activerecord (= 7.1.5.1)
381+
activestorage (= 7.1.5.1)
382+
activesupport (= 7.1.5.1)
364383
bundler (>= 1.15.0)
365-
railties (= 7.0.8.1)
384+
railties (= 7.1.5.1)
366385
rails-dom-testing (2.3.0)
367386
activesupport (>= 5.0.0)
368387
minitest
@@ -377,13 +396,14 @@ GEM
377396
rails_stdout_logging
378397
rails_serve_static_assets (0.0.5)
379398
rails_stdout_logging (0.0.5)
380-
railties (7.0.8.1)
381-
actionpack (= 7.0.8.1)
382-
activesupport (= 7.0.8.1)
383-
method_source
399+
railties (7.1.5.1)
400+
actionpack (= 7.1.5.1)
401+
activesupport (= 7.1.5.1)
402+
irb
403+
rackup (>= 1.0.0)
384404
rake (>= 12.2)
385-
thor (~> 1.0)
386-
zeitwerk (~> 2.5)
405+
thor (~> 1.0, >= 1.2.2)
406+
zeitwerk (~> 2.6)
387407
rainbow (3.1.1)
388408
rake (13.3.0)
389409
rake-compiler-dock (1.9.1)
@@ -461,6 +481,7 @@ GEM
461481
sprockets (> 3.0)
462482
sprockets-rails
463483
tilt
484+
securerandom (0.4.1)
464485
scout_apm (5.7.1)
465486
parser
466487
selenium-webdriver (4.34.0)
@@ -524,7 +545,8 @@ GEM
524545
bindex (>= 0.4.0)
525546
railties (>= 6.0.0)
526547
websocket (1.2.11)
527-
websocket-driver (0.7.6)
548+
websocket-driver (0.8.0)
549+
base64
528550
websocket-extensions (>= 0.1.0)
529551
websocket-extensions (0.1.5)
530552
xpath (3.2.0)
@@ -588,7 +610,7 @@ DEPENDENCIES
588610
puma (~> 6.6)
589611
pundit
590612
rack-mini-profiler (~> 4.0)
591-
rails (= 7.0.8.1)
613+
rails (~> 7.1.5.1)
592614
rails-html-sanitizer (~> 1.6.2)
593615
rails4-autocomplete
594616
rails_12factor

app/controllers/concerns/mailing_list_concerns.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ module MailingListConcerns
1010
module InstanceMethods
1111
def subscribe_to_newsletter(member)
1212
member.update(opt_in_newsletter_at: Time.zone.now)
13-
MailingList.new(ENV['NEWSLETTER_ID']).subscribe(member.email,
14-
member.name,
15-
member.surname)
13+
Services::MailingList.new(ENV['NEWSLETTER_ID']).subscribe(member.email,
14+
member.name,
15+
member.surname)
1616
end
1717

1818
def unsubscribe_from_newsletter(member)
1919
member.update(opt_in_newsletter_at: nil)
20-
MailingList.new(ENV['NEWSLETTER_ID']).unsubscribe(member.email)
20+
Services::MailingList.new(ENV['NEWSLETTER_ID']).unsubscribe(member.email)
2121
end
2222
end
2323
end

app/controllers/events_controller.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@ def index
1313
events << Event.past.includes(:venue, :sponsors).limit(RECENT_EVENTS_DISPLAY_LIMIT)
1414
events = events.compact.flatten.sort_by(&:date_and_time).reverse.first(RECENT_EVENTS_DISPLAY_LIMIT)
1515
events_hash_grouped_by_date = events.group_by(&:date)
16-
@past_events = events_hash_grouped_by_date.map.inject({}) do |hash, (key, value)|
16+
@past_events = events_hash_grouped_by_date.map.each_with_object({}) do |(key, value), hash|
1717
hash[key] = EventPresenter.decorate_collection(value)
18-
hash
1918
end
2019

2120
events = [Workshop.includes(:chapter).upcoming.joins(:chapter).merge(Chapter.active)]
2221
events << Meeting.upcoming.all
2322
events << Event.upcoming.includes(:venue, :sponsors).all
2423
events = events.compact.flatten.sort_by(&:date_and_time).group_by(&:date)
25-
@events = events.map.inject({}) { |hash, (key, value)| hash[key] = EventPresenter.decorate_collection(value); hash }
24+
@events = events.map.each_with_object({}) do |(key, value), hash|
25+
hash[key] = EventPresenter.decorate_collection(value)
26+
end
2627
end
2728

2829
def show
@@ -34,7 +35,7 @@ def show
3435
return unless logged_in?
3536

3637
invitation = Invitation.find_by(member: current_user, event: event, attending: true)
37-
return redirect_to event_invitation_path(@event, invitation) if invitation
38+
redirect_to event_invitation_path(@event, invitation) if invitation
3839
end
3940

4041
def student
@@ -47,7 +48,7 @@ def coach
4748

4849
def rsvp
4950
set_event
50-
ticket = Ticket.new(request, params)
51+
ticket = Services::Ticket.new(request, params)
5152
member = Member.find_by(email: ticket.email)
5253
invitation = member.invitations.where(event: @event, role: 'Student').try(:first)
5354
invitation ||= Invitation.create(event: @event, member: member, role: 'Student')

app/mailers/event_invitation_mailer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def attending(event, member, invitation)
3434

3535
require 'services/event_calendar'
3636
attachments['codebar.ics'] = { mime_type: 'text/calendar',
37-
content: EventCalendar.new(@event).calendar.to_ical }
37+
content: Services::EventCalendar.new(@event).calendar.to_ical }
3838

3939
subject = "Your spot to #{@event.name} has been confirmed."
4040

app/models/contact.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ class Contact < ApplicationRecord
55
validates :name, :surname, :email, presence: true
66

77
before_create :set_token
8-
after_commit :subscribe_to_mailing_list, if: proc { |c| c.mailing_list_consent }
98
after_commit :unsubscribe_from_mailing_list, if: proc { |c| !c.mailing_list_consent }
9+
after_commit :subscribe_to_mailing_list, if: proc { |c| c.mailing_list_consent }
1010

1111
def subscribe_to_mailing_list
1212
mailing_list.subscribe(email, name, surname)
@@ -18,7 +18,7 @@ def unsubscribe_from_mailing_list
1818
end
1919

2020
def mailing_list
21-
@mailing_list ||= MailingList.new(ENV['SPONSOR_NEWSLETTER_ID'])
21+
@mailing_list ||= Services::MailingList.new(ENV['SPONSOR_NEWSLETTER_ID'])
2222
end
2323

2424
private

app/models/group.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Group < ApplicationRecord
1313

1414
validates :name, presence: true, inclusion: { in: NAMES, message: 'Invalid name for Group' }
1515

16-
alias_attribute :city, :chapter
16+
alias city chapter
1717

1818
default_scope -> { joins(:chapter).includes(:chapter) }
1919

app/models/subscription.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ def coach?
2222
private
2323

2424
def subscribe_to_mailing_list
25-
MailingList.new(group.mailing_list_id).subscribe(member.email, member.name, member.surname)
25+
Services::MailingList.new(group.mailing_list_id).subscribe(member.email, member.name, member.surname)
2626
end
2727

2828
def unsubscribe_from_mailing_list
29-
MailingList.new(group.mailing_list_id).unsubscribe(member.email)
29+
Services::MailingList.new(group.mailing_list_id).unsubscribe(member.email)
3030
end
3131
end

0 commit comments

Comments
 (0)