FIX: Clear the cache after destroying theme_fields

FIX: Clear the cache after destroying theme_fields

diff --git a/app/models/theme_field.rb b/app/models/theme_field.rb
index 53d44b8..4064cab 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'

GitHub sha: 86fe423f