From b5faedb4ff8012dc6bf43ed18717d23c51de4821 Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Sat, 22 Sep 2018 13:12:23 -0500 Subject: [PATCH] Use `reload` to reload AR models Passing a boolean to the model method will stop working in Rails 5. Co-Authored-By: Dan Rice --- app/controllers/todos_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb index e3161c9f..0a079bfe 100644 --- a/app/controllers/todos_controller.rb +++ b/app/controllers/todos_controller.rb @@ -1030,12 +1030,12 @@ end context = current_user.contexts.find(todo.context_id) @remaining_deferred_or_pending_count = context.todos.deferred_or_blocked.count - remaining_actions_in_context = context.todos(true).active + remaining_actions_in_context = context.todos.reload.active remaining_actions_in_context = remaining_actions_in_context.not_hidden if !context.hidden? @remaining_in_context = remaining_actions_in_context.count if @todo_was_deferred_or_blocked - actions_in_target = current_user.contexts.find(@todo.context_id).todos(true).active + actions_in_target = current_user.contexts.find(@todo.context_id).todos.reload.active actions_in_target = actions_in_target.not_hidden if !context.hidden? else actions_in_target = @todo.context.todos.deferred_or_blocked @@ -1212,7 +1212,7 @@ end def update_tags if params[:tag_list] @todo.tag_with(params[:tag_list]) - @todo.tags(true) #force a reload for proper rendering + @todo.tags.reload #force a reload for proper rendering end end