2019-08-19 04:40:56 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class SiteCategorySerializer < BasicCategorySerializer
|
2023-02-28 12:09:20 -05:00
|
|
|
attributes :allowed_tags,
|
|
|
|
:allowed_tag_groups,
|
|
|
|
:allow_global_tags,
|
|
|
|
:read_only_banner,
|
|
|
|
:form_template_ids
|
2019-08-19 04:40:56 -04:00
|
|
|
|
2022-04-06 09:08:06 -04:00
|
|
|
has_many :category_required_tag_groups, key: :required_tag_groups, embed: :objects
|
|
|
|
|
2023-07-06 00:42:59 -04:00
|
|
|
def form_template_ids
|
|
|
|
object.form_template_ids.sort
|
|
|
|
end
|
|
|
|
|
2019-08-19 04:40:56 -04:00
|
|
|
def include_allowed_tags?
|
|
|
|
SiteSetting.tagging_enabled
|
|
|
|
end
|
|
|
|
|
|
|
|
def allowed_tags
|
|
|
|
object.tags.pluck(:name)
|
|
|
|
end
|
|
|
|
|
|
|
|
def include_allowed_tag_groups?
|
|
|
|
SiteSetting.tagging_enabled
|
|
|
|
end
|
|
|
|
|
|
|
|
def allowed_tag_groups
|
|
|
|
object.tag_groups.pluck(:name)
|
|
|
|
end
|
|
|
|
|
|
|
|
def include_allow_global_tags?
|
|
|
|
SiteSetting.tagging_enabled
|
|
|
|
end
|
|
|
|
|
2022-04-06 09:08:06 -04:00
|
|
|
def include_required_tag_groups?
|
|
|
|
SiteSetting.tagging_enabled
|
2019-10-30 14:49:00 -04:00
|
|
|
end
|
2019-08-19 04:40:56 -04:00
|
|
|
end
|