FEATURE: Calculate sprite-sheet based on currently active themes (#6973)

Previously there was only one sprite sheet, which always included icons from all themes even if they were disabled
This commit is contained in:
David Taylor
2019-02-06 15:51:23 +00:00
committed by GitHub
parent ba9cc83d4c
commit f3cfce4a93
8 changed files with 92 additions and 51 deletions

View File

@ -7,6 +7,10 @@ class ThemeField < ActiveRecord::Base
belongs_to :upload
has_one :javascript_cache, dependent: :destroy
after_commit do |field|
SvgSprite.expire_cache if field.target_id == Theme.targets[:settings]
end
scope :find_by_theme_ids, ->(theme_ids) {
return none unless theme_ids.present?