PERF: Remove extra PG query.

In `Theme.list_baked_fields`, common is always included as a target.
This commit is contained in:
Alan Guo Xiang Tan 2021-06-11 16:09:07 +08:00
parent b36396d925
commit 5f8f139ac9
1 changed files with 1 additions and 2 deletions

View File

@ -395,8 +395,7 @@ class Stylesheet::Manager
def theme_digest def theme_digest
if [:mobile_theme, :desktop_theme].include?(@target) if [:mobile_theme, :desktop_theme].include?(@target)
scss_digest = theme.resolve_baked_field(:common, :scss) scss_digest = theme.resolve_baked_field(@target.to_s.sub("_theme", ""), :scss)
scss_digest += theme.resolve_baked_field(@target.to_s.sub("_theme", ""), :scss)
elsif @target == :embedded_theme elsif @target == :embedded_theme
scss_digest = theme.resolve_baked_field(:common, :embedded_scss) scss_digest = theme.resolve_baked_field(:common, :embedded_scss)
else else