FIX: Watching First Post in groups was working incorrectly
This commit is contained in:
parent
c11f7bee99
commit
c279889191
|
@ -120,7 +120,7 @@ class PostAlerter
|
|||
.where(notification_level: TagUser.notification_levels[:watching_first_post])
|
||||
.pluck(:user_id)
|
||||
|
||||
group_ids = post.user.groups.pluck(:id)
|
||||
group_ids = topic.allowed_groups.pluck(:group_id)
|
||||
group_watchers = GroupUser.where(group_id: group_ids,
|
||||
notification_level: GroupUser.notification_levels[:watching_first_post])
|
||||
.pluck(:user_id)
|
||||
|
|
|
@ -363,6 +363,7 @@ describe PostAlerter do
|
|||
it "notifies the user who is following the first post group" do
|
||||
GroupUser.create(group_id: group.id, user_id: user.id)
|
||||
GroupUser.create(group_id: group.id, user_id: post.user.id)
|
||||
topic.topic_allowed_groups.create(group_id: group.id)
|
||||
|
||||
level = GroupUser.notification_levels[:watching_first_post]
|
||||
GroupUser.where(user_id: user.id, group_id: group.id).update_all(notification_level: level)
|
||||
|
|
Loading…
Reference in New Issue