PERF: Eradicate N+1 queries from the theme admin page

This commit is contained in:
David Taylor
2018-12-20 17:13:05 +00:00
committed by Sam
parent 2909e7fbdf
commit 7feabd9e49
6 changed files with 34 additions and 7 deletions

View File

@@ -9,6 +9,7 @@ class ThemeSetting < ActiveRecord::Base
theme.clear_cached_settings!
theme.remove_from_cache!
theme.theme_fields.update_all(value_baked: nil)
theme.theme_settings.reload
SvgSprite.expire_cache if self.name.to_s.include?("_icon")
CSP::Extension.clear_theme_extensions_cache! if name.to_s == CSP::Extension::THEME_SETTING
end