From 998f2fd5db9607f1b6969aba1fc3c2cbffa84762 Mon Sep 17 00:00:00 2001 From: sudeeptarlekar Date: Sun, 5 Jun 2022 22:47:02 +0530 Subject: [PATCH] Updated read me for update_attribute deprecation warning Signed-off-by: sudeeptarlekar --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7a199aa..5cee228 100644 --- a/README.md +++ b/README.md @@ -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