From 8481e780aa3e997aadf8f5ee3a5718a7fbbb02d5 Mon Sep 17 00:00:00 2001 From: navaneeth Date: Tue, 11 May 2021 00:58:06 +0530 Subject: [PATCH] Fix n+1 query in apps controller --- app/controllers/apps_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/apps_controller.rb b/app/controllers/apps_controller.rb index 2ad5f5778b..846b91aa5f 100644 --- a/app/controllers/apps_controller.rb +++ b/app/controllers/apps_controller.rb @@ -3,7 +3,7 @@ class AppsController < ApplicationController def index authorize App - @apps = App.where(organization: @current_user.organization).order('created_at desc') + @apps = App.where(organization: @current_user.organization).order('created_at desc').includes(:user) end def create