mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Fix 3N+1 query in /admin/customize/themes
(#14876)
This commit is contained in:
parent
13fdc979a8
commit
61d14a7694
@ -50,6 +50,7 @@ class Theme < ActiveRecord::Base
|
|||||||
:locale_fields,
|
:locale_fields,
|
||||||
:user,
|
:user,
|
||||||
:color_scheme,
|
:color_scheme,
|
||||||
|
:theme_translation_overrides,
|
||||||
theme_fields: :upload
|
theme_fields: :upload
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -216,8 +216,12 @@ class ThemeField < ActiveRecord::Base
|
|||||||
# this would reduce the size of the payload, without affecting functionality
|
# this would reduce the size of the payload, without affecting functionality
|
||||||
data = {}
|
data = {}
|
||||||
fallback_data.each { |hash| data.merge!(hash) }
|
fallback_data.each { |hash| data.merge!(hash) }
|
||||||
overrides = theme.translation_override_hash.deep_symbolize_keys
|
|
||||||
data.deep_merge!(overrides) if with_overrides
|
if with_overrides
|
||||||
|
overrides = theme.translation_override_hash.deep_symbolize_keys
|
||||||
|
data.deep_merge!(overrides)
|
||||||
|
end
|
||||||
|
|
||||||
data
|
data
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user