Merge pull request #739 from sudeeptarlekar/736-update-doc-for-deprecation-warning

Updated read me for update_attribute deprecation warning
This commit is contained in:
Kim Burgestrand 2022-08-10 14:24:26 +02:00 committed by GitHub
commit 56af8f3ce2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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
@ -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