.notifiable_users: compact the passed-in users
This commit is contained in:
parent
19309b9705
commit
8386d69f8f
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
module NotificationRecipientService
|
module NotificationRecipientService
|
||||||
def self.notifiable_users(users, *args)
|
def self.notifiable_users(users, *args)
|
||||||
users.map { |u| NotificationRecipient.new(u, *args) }.select(&:notifiable?).map(&:user)
|
users.compact.map { |u| NotificationRecipient.new(u, *args) }.select(&:notifiable?).map(&:user)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.notifiable?(user, *args)
|
def self.notifiable?(user, *args)
|
||||||
|
|
Loading…
Reference in New Issue