Skip to content

Commit

Permalink
Merge pull request #739 from sudeeptarlekar/736-update-doc-for-deprec…
Browse files Browse the repository at this point in the history
…ation-warning

Updated read me for update_attribute deprecation warning
  • Loading branch information
Burgestrand authored Aug 10, 2022
2 parents d7c2e6e + 998f2fd commit 56af8f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ You can now retrieve these attributes from the policy:
class PostsController < ApplicationController
def update
@post = Post.find(params[:id])
if @post.update_attributes(post_params)
if @post.update(post_params)
redirect_to @post
else
render :edit
Expand All @@ -714,7 +714,7 @@ However, this is a bit cumbersome, so Pundit provides a convenient helper method
class PostsController < ApplicationController
def update
@post = Post.find(params[:id])
if @post.update_attributes(permitted_attributes(@post))
if @post.update(permitted_attributes(@post))
redirect_to @post
else
render :edit
Expand Down

0 comments on commit 56af8f3

Please sign in to comment.