Increase notifiable access security on add notification method
This commit is contained in:
@@ -79,7 +79,8 @@ class CommentsController < ApplicationController
|
|||||||
|
|
||||||
def add_notification(comment)
|
def add_notification(comment)
|
||||||
notifiable = comment.reply? ? comment.parent : comment.commentable
|
notifiable = comment.reply? ? comment.parent : comment.commentable
|
||||||
if notifiable&.author_id.present? && notifiable.author_id != comment.author_id
|
notifiable_author_id = notifiable.try(:author_id)
|
||||||
|
if notifiable_author_id.present? && notifiable_author_id != comment.author_id
|
||||||
Notification.add(notifiable.author_id, notifiable)
|
Notification.add(notifiable.author_id, notifiable)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user