FIX: don't create new like notifications for deleted topics

This commit is contained in:
Neil Lalonde 2018-01-17 14:36:20 -05:00
parent f108bc3715
commit ec65ae76b9
1 changed files with 1 additions and 1 deletions

View File

@ -13,7 +13,7 @@ class PostActionNotifier
end end
def self.refresh_like_notification(post, read) def self.refresh_like_notification(post, read)
return unless post && post.user_id return unless post && post.user_id && post.topic
usernames = post.post_actions.where(post_action_type_id: PostActionType.types[:like]) usernames = post.post_actions.where(post_action_type_id: PostActionType.types[:like])
.joins(:user) .joins(:user)