FIX: Clear the cache after destroying theme_fields

This commit is contained in:
David Taylor 2019-02-12 16:39:40 +00:00
parent 91f0468f4e
commit 86fe423f5e
1 changed files with 6 additions and 4 deletions

View File

@ -372,10 +372,12 @@ class ThemeField < ActiveRecord::Base
end
end
after_commit on: [:create, :update] do
ensure_baked!
ensure_scss_compiles!
theme.clear_cached_settings!
after_commit do
unless destroyed?
ensure_baked!
ensure_scss_compiles!
theme.clear_cached_settings!
end
Stylesheet::Manager.clear_theme_cache! if self.name.include?("scss")
CSP::Extension.clear_theme_extensions_cache! if name == 'yaml'