FIX: Inviting a group that I am part of creates a notification.

https://meta.discourse.org/t/inviting-a-group-to-a-message-does-not-trigger-a-notification-mail/50509/10?u=tgxworld
This commit is contained in:
Guo Xiang Tan 2018-03-05 13:49:11 +08:00
parent 42e0aaed61
commit 07f1d90b88
2 changed files with 3 additions and 1 deletions

View File

@ -765,7 +765,8 @@ SQL
group_id = group.id
group.users.where(
"group_users.notification_level > ?", NotificationLevels.all[:muted]
"group_users.notification_level > ? AND user_id != ?",
NotificationLevels.all[:muted], user.id
).find_each do |u|
u.notifications.create!(

View File

@ -675,6 +675,7 @@ describe Topic do
group.add(user)
group.add(user_2)
group.add(topic.user)
group.group_users.find_by(user: user_2).update!(
notification_level: NotificationLevels.all[:muted]