PERF: no need to select the full theme just to get color scheme

This commit is contained in:
Sam Saffron 2019-03-26 17:53:02 +11:00
parent b58c965aad
commit 3cfedc6c71

View File

@ -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