Prevent error when no one is subscribed
This commit is contained in:
parent
b93058b11d
commit
9c4b2e452a
|
@ -32,7 +32,7 @@ class Subscription < ApplicationRecord
|
|||
{ target_id: source.id, target_type: Comment, recipient_id: s.user_id, new: true, type: Notification::Commented }
|
||||
end
|
||||
|
||||
Notification.insert_all!(notifications) # rubocop:disable Rails/SkipsModelValidations
|
||||
Notification.insert_all!(notifications) unless notifications.empty? # rubocop:disable Rails/SkipsModelValidations
|
||||
end
|
||||
|
||||
def denotify(source, target)
|
||||
|
|
Loading…
Reference in New Issue