Skip to content

Commit ca28a43

Browse files
authored
Merge branch 'main' into mxg-invite-links
2 parents 1a3ba24 + c50c7a3 commit ca28a43

31 files changed

+433
-386
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ruby file: ".ruby-version"
66

77
gem "dotenv-rails", groups: [:development, :test]
88

9-
gem "rails", "~> 7.2"
9+
gem "rails", "~> 8.0"
1010

1111
gem "puma", "~> 6.6" # app server
1212

Gemfile.lock

Lines changed: 60 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -18,46 +18,45 @@ GEM
1818
specs:
1919
aasm (5.5.0)
2020
concurrent-ruby (~> 1.0)
21-
actioncable (7.2.2.2)
22-
actionpack (= 7.2.2.2)
23-
activesupport (= 7.2.2.2)
21+
actioncable (8.0.4)
22+
actionpack (= 8.0.4)
23+
activesupport (= 8.0.4)
2424
nio4r (~> 2.0)
2525
websocket-driver (>= 0.6.1)
2626
zeitwerk (~> 2.6)
27-
actionmailbox (7.2.2.2)
28-
actionpack (= 7.2.2.2)
29-
activejob (= 7.2.2.2)
30-
activerecord (= 7.2.2.2)
31-
activestorage (= 7.2.2.2)
32-
activesupport (= 7.2.2.2)
27+
actionmailbox (8.0.4)
28+
actionpack (= 8.0.4)
29+
activejob (= 8.0.4)
30+
activerecord (= 8.0.4)
31+
activestorage (= 8.0.4)
32+
activesupport (= 8.0.4)
3333
mail (>= 2.8.0)
34-
actionmailer (7.2.2.2)
35-
actionpack (= 7.2.2.2)
36-
actionview (= 7.2.2.2)
37-
activejob (= 7.2.2.2)
38-
activesupport (= 7.2.2.2)
34+
actionmailer (8.0.4)
35+
actionpack (= 8.0.4)
36+
actionview (= 8.0.4)
37+
activejob (= 8.0.4)
38+
activesupport (= 8.0.4)
3939
mail (>= 2.8.0)
4040
rails-dom-testing (~> 2.2)
41-
actionpack (7.2.2.2)
42-
actionview (= 7.2.2.2)
43-
activesupport (= 7.2.2.2)
41+
actionpack (8.0.4)
42+
actionview (= 8.0.4)
43+
activesupport (= 8.0.4)
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.2)
53-
actionpack (= 7.2.2.2)
54-
activerecord (= 7.2.2.2)
55-
activestorage (= 7.2.2.2)
56-
activesupport (= 7.2.2.2)
51+
actiontext (8.0.4)
52+
actionpack (= 8.0.4)
53+
activerecord (= 8.0.4)
54+
activestorage (= 8.0.4)
55+
activesupport (= 8.0.4)
5756
globalid (>= 0.6.0)
5857
nokogiri (>= 1.8.5)
59-
actionview (7.2.2.2)
60-
activesupport (= 7.2.2.2)
58+
actionview (8.0.4)
59+
activesupport (= 8.0.4)
6160
builder (~> 3.1)
6261
erubi (~> 1.11)
6362
rails-dom-testing (~> 2.2)
@@ -68,26 +67,26 @@ GEM
6867
activestorage (>= 6.1.4)
6968
activesupport (>= 6.1.4)
7069
marcel (>= 1.0.3)
71-
activejob (7.2.2.2)
72-
activesupport (= 7.2.2.2)
70+
activejob (8.0.4)
71+
activesupport (= 8.0.4)
7372
globalid (>= 0.3.6)
7473
activejob-traffic_control (0.1.3)
7574
activejob (>= 4.2)
7675
activesupport (>= 4.2)
7776
suo
78-
activemodel (7.2.2.2)
79-
activesupport (= 7.2.2.2)
80-
activerecord (7.2.2.2)
81-
activemodel (= 7.2.2.2)
82-
activesupport (= 7.2.2.2)
77+
activemodel (8.0.4)
78+
activesupport (= 8.0.4)
79+
activerecord (8.0.4)
80+
activemodel (= 8.0.4)
81+
activesupport (= 8.0.4)
8382
timeout (>= 0.4.0)
84-
activestorage (7.2.2.2)
85-
actionpack (= 7.2.2.2)
86-
activejob (= 7.2.2.2)
87-
activerecord (= 7.2.2.2)
88-
activesupport (= 7.2.2.2)
83+
activestorage (8.0.4)
84+
actionpack (= 8.0.4)
85+
activejob (= 8.0.4)
86+
activerecord (= 8.0.4)
87+
activesupport (= 8.0.4)
8988
marcel (~> 1.0)
90-
activesupport (7.2.2.2)
89+
activesupport (8.0.4)
9190
base64
9291
benchmark (>= 0.3)
9392
bigdecimal
@@ -99,6 +98,7 @@ GEM
9998
minitest (>= 5.1)
10099
securerandom (>= 0.3)
101100
tzinfo (~> 2.0, >= 2.0.5)
101+
uri (>= 0.13.1)
102102
acts_as_paranoid (0.10.3)
103103
activerecord (>= 6.1, < 8.1)
104104
activesupport (>= 6.1, < 8.1)
@@ -635,34 +635,35 @@ GEM
635635
rack-timeout (0.7.0)
636636
rackup (2.2.1)
637637
rack (>= 3)
638-
rails (7.2.2.2)
639-
actioncable (= 7.2.2.2)
640-
actionmailbox (= 7.2.2.2)
641-
actionmailer (= 7.2.2.2)
642-
actionpack (= 7.2.2.2)
643-
actiontext (= 7.2.2.2)
644-
actionview (= 7.2.2.2)
645-
activejob (= 7.2.2.2)
646-
activemodel (= 7.2.2.2)
647-
activerecord (= 7.2.2.2)
648-
activestorage (= 7.2.2.2)
649-
activesupport (= 7.2.2.2)
638+
rails (8.0.4)
639+
actioncable (= 8.0.4)
640+
actionmailbox (= 8.0.4)
641+
actionmailer (= 8.0.4)
642+
actionpack (= 8.0.4)
643+
actiontext (= 8.0.4)
644+
actionview (= 8.0.4)
645+
activejob (= 8.0.4)
646+
activemodel (= 8.0.4)
647+
activerecord (= 8.0.4)
648+
activestorage (= 8.0.4)
649+
activesupport (= 8.0.4)
650650
bundler (>= 1.15.0)
651-
railties (= 7.2.2.2)
651+
railties (= 8.0.4)
652652
rails-dom-testing (2.3.0)
653653
activesupport (>= 5.0.0)
654654
minitest
655655
nokogiri (>= 1.6)
656656
rails-html-sanitizer (1.6.2)
657657
loofah (~> 2.21)
658658
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)
659-
railties (7.2.2.2)
660-
actionpack (= 7.2.2.2)
661-
activesupport (= 7.2.2.2)
659+
railties (8.0.4)
660+
actionpack (= 8.0.4)
661+
activesupport (= 8.0.4)
662662
irb (~> 1.13)
663663
rackup (>= 1.0.0)
664664
rake (>= 12.2)
665665
thor (~> 1.0, >= 1.2.2)
666+
tsort (>= 0.2)
666667
zeitwerk (~> 2.6)
667668
rainbow (3.1.1)
668669
rake (13.3.0)
@@ -836,6 +837,7 @@ GEM
836837
openssl (> 2.0)
837838
openssl-signature_algorithm (~> 1.0)
838839
trailblazer-option (0.1.2)
840+
tsort (0.2.0)
839841
turbo-rails (2.0.17)
840842
actionpack (>= 7.1.0)
841843
railties (>= 7.1.0)
@@ -854,6 +856,7 @@ GEM
854856
unicode-emoji (~> 4.0, >= 4.0.4)
855857
unicode-emoji (4.0.4)
856858
uniform_notifier (1.17.0)
859+
uri (1.0.4)
857860
useragent (0.16.11)
858861
validates_email_format_of (1.8.2)
859862
i18n (>= 0.8.0)
@@ -883,7 +886,7 @@ GEM
883886
event_emitter
884887
mutex_m
885888
websocket
886-
websocket-driver (0.7.7)
889+
websocket-driver (0.8.0)
887890
base64
888891
websocket-extensions (>= 0.1.0)
889892
websocket-extensions (0.1.5)
@@ -1001,7 +1004,7 @@ DEPENDENCIES
10011004
rack-cors
10021005
rack-mini-profiler (~> 3.3)
10031006
rack-timeout
1004-
rails (~> 7.2)
1007+
rails (~> 8.0)
10051008
react-rails
10061009
redcarpet
10071010
redis (~> 5.4)

app/controllers/ach_transfers_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class AchTransfersController < ApplicationController
44
include SetEvent
55

6-
before_action :set_ach_transfer, except: [:new, :create, :index, :validate_routing_number]
6+
before_action :set_ach_transfer, except: [:new, :create, :validate_routing_number]
77
before_action :set_event, only: [:new, :create]
88
skip_before_action :signed_in_user, except: [:validate_routing_number]
99
skip_after_action :verify_authorized, only: [:validate_routing_number]

app/controllers/api/v4/stripe_cards_controller.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,20 @@ def ephemeral_keys
156156

157157
end
158158

159+
def card_designs
160+
if params[:event_id].present?
161+
set_api_event
162+
authorize @event, :create_stripe_card?, policy_class: EventPolicy
163+
164+
@designs = [@event.stripe_card_personalization_designs&.available, StripeCard::PersonalizationDesign.common.available].flatten.compact
165+
else
166+
skip_authorization
167+
@designs = StripeCard::PersonalizationDesign.common.available
168+
end
169+
170+
@designs += StripeCard::PersonalizationDesign.unlisted.available if current_user.auditor?
171+
end
172+
159173
end
160174
end
161175
end

app/controllers/events_controller.rb

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class EventsController < ApplicationController
77
include SetEvent
88

99
include Rails::Pagination
10-
before_action :set_event, except: [:index, :new, :create]
10+
before_action :set_event, except: [:index]
1111
before_action :set_transaction_filters, only: [:transactions, :ledger]
1212
before_action except: [:show, :index] do
1313
render_back_to_tour @organizer_position, :welcome, event_path(@event)
@@ -1344,20 +1344,21 @@ def show_running_balance?
13441344
end
13451345

13461346
def set_cacheable
1347-
return false unless params[:q].blank? &&
1348-
params[:page].blank? &&
1349-
params[:per].blank? &&
1350-
@user.nil? &&
1351-
@tag.blank? &&
1352-
@type.blank? &&
1353-
@start_date.blank? &&
1354-
@end_date.blank? &&
1355-
@minimum_amount.nil? &&
1356-
@maximum_amount.nil? &&
1357-
!@missing_receipts
1358-
return false if organizer_signed_in?
1359-
1360-
true
1347+
has_filters = !(
1348+
params[:q].blank? &&
1349+
params[:page].blank? &&
1350+
params[:per].blank? &&
1351+
@user.nil? &&
1352+
@tag.blank? &&
1353+
@type.blank? &&
1354+
@start_date.blank? &&
1355+
@end_date.blank? &&
1356+
@minimum_amount.nil? &&
1357+
@maximum_amount.nil? &&
1358+
!@missing_receipts
1359+
)
1360+
1361+
@cacheable = !(organizer_signed_in? || has_filters)
13611362
end
13621363

13631364
def set_mock_data

app/controllers/reimbursement/reports_controller.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,15 @@ def wise_transfer_quote
8888
def wise_transfer_breakdown
8989
authorize @report
9090

91-
@with_fees_quote_amount = @report.wise_transfer_quote_amount
92-
@without_fees_quote_amount = @report.wise_transfer_quote_without_fees_amount
93-
@fees_amount = @with_fees_quote_amount - @without_fees_quote_amount
91+
if @report.payout_holding.present?
92+
@with_fees_quote_amount = Money.from_cents(@report.payout_holding.amount_cents)
93+
@fees_amount = Money.from_cents(@report.fees_charged_cents)
94+
@without_fees_quote_amount = @with_fees_quote_amount - @fees_amount
95+
else
96+
@with_fees_quote_amount = @report.wise_transfer_quote_amount
97+
@without_fees_quote_amount = @report.wise_transfer_quote_without_fees_amount
98+
@fees_amount = @with_fees_quote_amount - @without_fees_quote_amount
99+
end
94100

95101
render :wise_transfer_breakdown, layout: false
96102
end
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# frozen_string_literal: true
2+
3+
module OneTimeJobs
4+
class EnableMonthlyAnnouncements < ApplicationJob
5+
def perform(exclude_ids:)
6+
eligible_events = Event.transparent.organized_by_teenagers.where.not(id: exclude_ids).includes(:config).where(config: { generate_monthly_announcement: false }, id: OrganizerPosition.pluck(:event_id))
7+
8+
eligible_events.each do |event|
9+
event.config.update!(generate_monthly_announcement: true)
10+
11+
# A callback on Event::Configuration will automatically create a new monthly announcement when the column is updated
12+
monthly_announcement = event.announcements.monthly.last
13+
14+
AnnouncementMailer.with(event:, monthly_announcement:).notice.deliver_later
15+
end
16+
end
17+
18+
end
19+
20+
end

app/jobs/one_time_jobs/send_announcement_notice.rb

Lines changed: 0 additions & 17 deletions
This file was deleted.

app/mailers/announcement_mailer.rb

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,9 @@ def notice
2828

2929
@monthly_announcement = params[:monthly_announcement]
3030
@scheduled_for = Date.today.next_month.beginning_of_month
31+
@warning_date = @scheduled_for - 7.days
3132

32-
@cancellation_email = Ahoy::Message.where(sent_at: Date.today.beginning_of_month.., subject: "[#{@event.name}] Your scheduled monthly announcement has been canceled").first
33-
34-
if @cancellation_email.present?
35-
email = Mail.read_from_string(@cancellation_email.content)
36-
message_id = email.message_id
37-
38-
mail to: @emails, subject: "[#{@event.name}] Explaining monthly announcements", in_reply_to: message_id, references: message_id
39-
else
40-
mail to: @emails, subject: "[#{@event.name}] Monthly announcements are enabled for your organization"
41-
end
33+
mail to: @emails, subject: "[#{@event.name}] Monthly announcements have been enabled for your organization"
4234
end
4335

4436
def set_warning_variables

app/models/event.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ def descendants
214214
scope :demo_mode, -> { where(demo_mode: true) }
215215
scope :not_demo_mode, -> { where(demo_mode: false) }
216216
scope :filter_demo_mode, ->(demo_mode) { demo_mode.nil? ? all : where(demo_mode:) }
217+
scope :financially_frozen, -> { where(financially_frozen: true) }
217218

218219
before_validation :enforce_transparency_eligibility
219220

0 commit comments

Comments
 (0)