mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
PERF: Don't serialize value for theme_fields unnecessarily (#21201)
The value field of ThemeField is only used when viewing a diff in the staff action logs and local theme editing. value is being serialized into the theme index as well, which is not used. It's a huge amount of JSON that we can cut by removing it. This also breaks up the various theme serializers into separate classes so they autoload properly (or at least restart the server on edit)
This commit is contained in:
committed by
GitHub
parent
599979902e
commit
012aaf0ba3
13
app/serializers/basic_theme_serializer.rb
Normal file
13
app/serializers/basic_theme_serializer.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class BasicThemeSerializer < ApplicationSerializer
|
||||
attributes :id, :name, :created_at, :updated_at, :default, :component
|
||||
|
||||
def include_default?
|
||||
object.id == SiteSetting.default_theme_id
|
||||
end
|
||||
|
||||
def default
|
||||
true
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user