From 3cfedc6c71efa0f7709b5cbaf2fdae64235b7394 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Tue, 26 Mar 2019 17:53:02 +1100 Subject: [PATCH] PERF: no need to select the full theme just to get color scheme --- app/helpers/application_helper.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 81d28e90f3f..22c24fafb32 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -390,8 +390,10 @@ module ApplicationHelper def scheme_id return if theme_ids.blank? - theme = Theme.find_by(id: theme_ids.first) - theme&.color_scheme_id + Theme + .where(id: theme_ids.first) + .pluck(:color_scheme_id) + .first end def current_homepage