Skip to content

A platform for community discussion. Free, open, simple.

FIX: Live refresh parent themes when editing child themes

David Taylor260398d70662
diff --git a/app/models/theme.rb b/app/models/theme.rb
index 133466079f1..46bd55fde9b 100644
--- a/app/models/theme.rb
+++ b/app/models/theme.rb
@@ -242,7 +242,8 @@ class Theme < ActiveRecord::Base
if all_themes
message = theme_ids.map { |id| refresh_message_for_targets(targets, id) }.flatten
else
- message = refresh_message_for_targets(targets, theme_ids).flatten
+ parent_ids = Theme.where(id: theme_ids).joins(:parent_themes).pluck(:parent_theme_id).uniq
+ message = refresh_message_for_targets(targets, theme_ids | parent_ids).flatten
end
MessageBus.publish('/file-change', message)