From 4e573b4ac62c5d2ec40854b100c45a596f69b695 Mon Sep 17 00:00:00 2001 From: joshua stein Date: Sun, 2 Aug 2015 20:03:17 -0500 Subject: [PATCH] mail_new_activity: use Story method for determining if user hid the story Fixes #141 --- script/mail_new_activity | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/script/mail_new_activity b/script/mail_new_activity index 9bf1f03..1565690 100755 --- a/script/mail_new_activity +++ b/script/mail_new_activity @@ -79,8 +79,7 @@ Story.where("id > ? AND is_expired = ?", last_story_id, false).order(:id).each d next end - if Vote.where(:user_id => u.id, :story_id => s.id, :comment_id => nil, - :vote => 0).first + if s.is_hidden_by_user?(u) # user has hidden this story next end @@ -164,8 +163,7 @@ last_comment_id, false, false).order(:id).each do |c| next end - if Vote.where(:user_id => u.id, :story_id => c.story_id, - :comment_id => nil, :vote => 0).first + if c.story.is_hidden_by_user?(u) # user has hidden this story next end