2013-05-10 02:47:47 -04:00
|
|
|
class BasicCategorySerializer < ApplicationSerializer
|
|
|
|
|
|
|
|
attributes :id,
|
|
|
|
:name,
|
|
|
|
:color,
|
|
|
|
:text_color,
|
|
|
|
:slug,
|
|
|
|
:topic_count,
|
2014-05-28 13:33:39 -04:00
|
|
|
:post_count,
|
2013-05-10 02:47:47 -04:00
|
|
|
:description,
|
|
|
|
:topic_url,
|
2013-07-16 01:44:07 -04:00
|
|
|
:read_restricted,
|
2013-10-23 13:29:20 -04:00
|
|
|
:permission,
|
2014-04-17 05:17:39 -04:00
|
|
|
:parent_category_id,
|
|
|
|
:notification_level
|
2013-05-10 02:47:47 -04:00
|
|
|
|
2013-10-23 14:40:39 -04:00
|
|
|
def include_parent_category_id?
|
|
|
|
parent_category_id
|
|
|
|
end
|
2014-06-24 17:27:29 -04:00
|
|
|
|
|
|
|
def description
|
|
|
|
object.uncategorized? ? SiteSetting.uncategorized_description : object.description
|
|
|
|
end
|
2013-05-10 02:47:47 -04:00
|
|
|
end
|