mirror of
https://github.com/discourse/discourse.git
synced 2024-12-24 01:03:45 +08:00
012aaf0ba3
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)
32 lines
804 B
Ruby
32 lines
804 B
Ruby
# frozen_string_literal: true
|
|
|
|
class RemoteThemeSerializer < ApplicationSerializer
|
|
attributes :id,
|
|
:remote_url,
|
|
:remote_version,
|
|
:local_version,
|
|
:commits_behind,
|
|
:branch,
|
|
:remote_updated_at,
|
|
:updated_at,
|
|
:github_diff_link,
|
|
:last_error_text,
|
|
:is_git?,
|
|
:license_url,
|
|
:about_url,
|
|
:authors,
|
|
:theme_version,
|
|
:minimum_discourse_version,
|
|
:maximum_discourse_version
|
|
|
|
# wow, AMS has some pretty nutty logic where it tries to find the path here
|
|
# from action dispatch, tell it not to
|
|
def about_url
|
|
object.about_url
|
|
end
|
|
|
|
def include_github_diff_link?
|
|
github_diff_link.present?
|
|
end
|
|
end
|