FIX: changing component settings should trigger refresh for parent theme CSS (#6340)

This commit is contained in:
Osama Sayegh
2018-08-30 13:53:03 +03:00
committed by Sam
parent 3ed9533066
commit 9efbf2c49f
2 changed files with 25 additions and 3 deletions

View File

@ -302,13 +302,16 @@ class Stylesheet::Manager
end
def settings_digest
theme_ids = Theme.components_for(@theme_id).dup
theme_ids << @theme_id
fields = ThemeField.where(
name: "yaml",
type_id: ThemeField.types[:yaml],
theme_id: @theme_id
theme_id: theme_ids
).pluck(:updated_at)
settings = ThemeSetting.where(theme_id: @theme_id).pluck(:updated_at)
settings = ThemeSetting.where(theme_id: theme_ids).pluck(:updated_at)
timestamps = fields.concat(settings).map!(&:to_f).sort!.join(",")
Digest::SHA1.hexdigest(timestamps)