From 86fe423f5eb8aa0eb8534d06eeb5848678630412 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 12 Feb 2019 16:39:40 +0000 Subject: [PATCH] FIX: Clear the cache after destroying theme_fields --- app/models/theme_field.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/models/theme_field.rb b/app/models/theme_field.rb index 53d44b8c7a1..4064cabf162 100644 --- a/app/models/theme_field.rb +++ b/app/models/theme_field.rb @@ -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'