Handle missing commentable for user_is_commentable_author? check (#5336) [deploy]

This commit is contained in:
Molly Struve 2020-01-02 18:06:05 -05:00 committed by Mac Siri
parent cb98b3b510
commit c64bfdb652

View file

@ -64,6 +64,6 @@ class CommentPolicy < ApplicationPolicy
end
def user_is_commentable_author?
record.commentable.user_id == user.id
record.commentable.present? && record.commentable.user_id == user.id
end
end