From b9ad36fa6b00ca49ffd43c1ee5339d072de5e158 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Fri, 7 Oct 2016 00:41:10 +0300 Subject: [PATCH] Optimize talk preferences export Eager load all associated selected talks --- app/controllers/home_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index cf23130..40e2f29 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -9,6 +9,6 @@ class HomeController < ApplicationController end def export - @talk_preferences = TalkPreference.this_years + @talk_preferences = TalkPreference.this_years.eager_load(:selected_talks) end end