Class: CategoryBadgeSerializer
Instance Method Summary
collapse
expire_cache_fragment!, fragment_cache
#include!
Instance Method Details
#description_text ⇒ Object
18
19
20
21
22
23
24
|
# File 'app/serializers/category_badge_serializer.rb', line 18
def description_text
if object.uncategorized?
I18n.t("category.uncategorized_description", locale: SiteSetting.default_locale)
else
object.description_text
end
end
|
#include_parent_category_id? ⇒ Boolean
6
7
8
|
# File 'app/serializers/category_badge_serializer.rb', line 6
def include_parent_category_id?
parent_category_id.present?
end
|
#name ⇒ Object
10
11
12
13
14
15
16
|
# File 'app/serializers/category_badge_serializer.rb', line 10
def name
if object.uncategorized?
I18n.t("uncategorized_category_name", locale: SiteSetting.default_locale)
else
object.name
end
end
|