Skip to content

Commit 50b691f

Browse files
committed
Set updated_by_id with current_users id on post update
1 parent f417381 commit 50b691f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/controllers/posts_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def create
2626
end
2727

2828
def update
29-
if @post.update(post_params)
29+
if @post.update(post_params.merge(updated_by_id: current_user.id))
3030
redirect_to @post, notice: 'Post was successfully updated.'
3131
else
3232
render :edit

0 commit comments

Comments
 (0)