A platform for community discussion. Free, open, simple.
DEV: Don't try to update child themes in tests (#28080)
Jarek Radosz4c7470d5cb3f
diff --git a/app/models/remote_theme.rb b/app/models/remote_theme.rbindex 620f5de16aa..8b8452fd3d8 100644--- a/app/models/remote_theme.rb+++ b/app/models/remote_theme.rb@@ -85,7 +85,7 @@ class RemoteTheme < ActiveRecord::Base# This is only used in the development and test environment and is currently not supported for other environmentsif Rails.env.test? || Rails.env.development?def self.import_theme_from_directory(directory)- update_theme(ThemeStore::DirectoryImporter.new(directory))+ update_theme(ThemeStore::DirectoryImporter.new(directory), update_components: "none")endend@@ -109,6 +109,7 @@ class RemoteTheme < ActiveRecord::Basetheme.component = theme_info["component"].to_s == "true"theme.child_components = child_components = theme_info["components"].presence || []+ theme.skip_child_components_update = true if update_components == "none"remote_theme = newremote_theme.theme = themediff --git a/app/models/theme.rb b/app/models/theme.rbindex 7eef07af10a..fbfb36c7eb8 100644--- a/app/models/theme.rb+++ b/app/models/theme.rb@@ -12,6 +12,7 @@ class Theme < ActiveRecord::Baseendattr_accessor :child_components+ attr_accessor :skip_child_components_updatedef self.cache@cache ||= DistributedCache.new("theme:compiler:#{BASE_COMPILER_VERSION}")@@ -152,7 +153,7 @@ class Theme < ActiveRecord::Baseenddef update_child_components- if !component? && child_components.present?+ if !component? && child_components.present? && !skip_child_components_updatechild_components.each do |url|url = ThemeStore::GitImporter.new(url.strip).urltheme = RemoteTheme.find_by(remote_url: url)&.theme