From 73c8b333fe434b004eab3e3b0bd56299cc300351 Mon Sep 17 00:00:00 2001 From: Tlazypanda <33183263+Tlazypanda@users.noreply.github.com> Date: Sat, 25 Jul 2020 18:35:17 +0530 Subject: [PATCH] remove n+1 query from revision#path method --- app/controllers/home_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 522b10eac4..59e9fcd06a 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -111,6 +111,7 @@ def activity .order('nid DESC') .limit(10) revisions = Revision.joins(:node) + .includes(:node) .order('timestamp DESC') .where('type = (?)', 'page') .where('node.status = 1')