diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index c30ddbaf2..2ce536c5c 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -65,11 +65,11 @@ class CommentsController < ApplicationController def add_notification(comment) if comment.reply? - author = comment.parent.author + notifiable = comment.parent else - author = comment.commentable.author + notifiable = comment.commentable end - author.notifications.create!(notifiable: comment) unless comment.made_by? author + Notification.create!(user_id: notifiable.author_id, notifiable: comment) unless comment.author_id == notifiable.author_id end end