Fix a bug in comments controller

This commit is contained in:
riggraz
2019-10-09 15:23:59 +02:00
parent 9dc3cbc881
commit 22fd672efd

View File

@@ -34,7 +34,8 @@ class CommentsController < ApplicationController
end
def update
comment = Comment.find_by(post_id: params[:post_id])
comment = Comment.find(params[:id])
comment.assign_attributes(comment_params)
if !current_user.power_user? && current_user.id != post.user_id