Skip to content

Commit 19aaef0

Browse files
authored
[Announcements] Unlink transparency mode and monthly announcements (#11945)
## Summary of the problem <!-- Why are these changes being made? What problem does it solve? Link any related issues to provide more details. --> See #11944 for context - for now, we've decided to not automatically link transparency mode to enabling monthly announcements as it doesn't give the event managers any chance to get context on what monthly announcements are. ## Describe your changes <!-- Explain your thought process to the solution and provide a quick summary of the changes. --> Remove the callbacks on `Event::Configuration` and `Event` that automatically enabled monthly announcements if the event was/became transparent. <!-- If there are any visual changes, please attach images, videos, or gifs. -->
1 parent 596154a commit 19aaef0

File tree

2 files changed

+0
-13
lines changed

2 files changed

+0
-13
lines changed

app/models/event.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,6 @@ def ancestor_organizer_positions
451451
after_validation :move_friendly_id_error_to_slug
452452

453453
after_update :generate_stripe_card_designs, if: -> { attachment_changes["stripe_card_logo"].present? && stripe_card_logo.attached? && !Rails.env.test? }
454-
before_save :enable_monthly_announcements
455454

456455
# We can't do this through a normal dependent: :destroy since ActiveRecord does not support deleting records through indirect has_many associations
457456
# https://github.com/rails/rails/commit/05bcb8cecc8573f28ad080839233b4bb9ace07be
@@ -969,13 +968,6 @@ def enforce_transparency_eligibility
969968
end
970969
end
971970

972-
def enable_monthly_announcements
973-
# We'll enable monthly announcements when transparency mode is turned on
974-
if is_public_changed?(to: true)
975-
config.update(generate_monthly_announcement: true)
976-
end
977-
end
978-
979971
def stripe_transaction_merchant(transaction)
980972
merchant_data = transaction.stripe_transaction["merchant_data"]
981973
yp_merchant = YellowPages::Merchant.lookup(network_id: merchant_data["network_id"])

app/models/event/configuration.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,10 @@ class Configuration < ApplicationRecord
2929
normalizes :contact_email, with: ->(contact_email) { contact_email.strip.downcase }
3030
validates :subevent_plan, inclusion: { in: -> { Event::Plan.available_plans.map(&:name) } }, allow_blank: true
3131

32-
before_create :set_defaults
3332
after_save :create_or_destroy_monthly_announcement
3433

3534
private
3635

37-
def set_defaults
38-
self.generate_monthly_announcement = event.is_public if self.generate_monthly_announcement.nil?
39-
end
40-
4136
def create_or_destroy_monthly_announcement
4237
if self.generate_monthly_announcement_previously_changed?
4338
if self.generate_monthly_announcement

0 commit comments

Comments
 (0)