Skip to content

Commit

Permalink
Adapt to core api change hitobito/hitobito#998281907
Browse files Browse the repository at this point in the history
For performance reason we no longer load all people to check if a person
is subscribed, so we have to cater for that here
  • Loading branch information
amaierhofer committed Jan 24, 2025
1 parent d8afaf7 commit 2d82bb1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/domain/jubla/mailing_lists/subscribers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
module Jubla::MailingLists::Subscribers
extend ActiveSupport::Concern

def subscribed?(person)
super && excluded_by_contact_preference.where(id: person.id).empty?
end

def people_as_configured
super.where.not(id: excluded_by_contact_preference.select(:id))
end
Expand Down

0 comments on commit 2d82bb1

Please sign in to comment.