FIX: deleting category background images sometimes has no effect

This commit is contained in:
Neil Lalonde
2017-10-04 17:04:29 -04:00
parent 4771b0a99f
commit f5a2ed99b0
4 changed files with 27 additions and 13 deletions

View File

@@ -257,7 +257,7 @@ class Stylesheet::Manager
def color_scheme_digest
cs = theme&.color_scheme
category_updated = Category.where("uploaded_background_id IS NOT NULL").last_updated_at
category_updated = Category.where("uploaded_background_id IS NOT NULL").pluck(:updated_at).map(&:to_i).sum
if cs || category_updated > 0
Digest::SHA1.hexdigest "#{RailsMultisite::ConnectionManagement.current_db}-#{cs&.id}-#{cs&.version}-#{Stylesheet::Manager.last_file_updated}-#{category_updated}"