FIX: don't notify on link reflections

This commit is contained in:
Sam 2014-07-29 15:40:05 +10:00
parent b2e29526ff
commit 5d9eefbfed
2 changed files with 6 additions and 1 deletions

View file

@ -144,7 +144,7 @@ class PostAlerter
end
def extract_linked_users(post)
post.topic_links.map do |link|
post.topic_links.where(reflection: false).map do |link|
linked_post = link.link_post
if !linked_post && topic = link.link_topic
linked_post = topic.posts(post_number: 1).first

View file

@ -44,6 +44,11 @@ describe PostAlerter do
user.reload
user.notifications.count.should == 1
# don't notify on reflection
post1.reload
PostAlerter.new.extract_linked_users(post1).length.should == 0
end
end