2013-05-10 01:47:47 -05:00
|
|
|
class BasicCategorySerializer < ApplicationSerializer
|
|
|
|
|
|
|
|
attributes :id,
|
|
|
|
:name,
|
|
|
|
:color,
|
|
|
|
:text_color,
|
|
|
|
:slug,
|
|
|
|
:topic_count,
|
2014-05-28 12:33:39 -05:00
|
|
|
:post_count,
|
2013-05-10 01:47:47 -05:00
|
|
|
:description,
|
|
|
|
:topic_url,
|
2013-07-16 00:44:07 -05:00
|
|
|
:read_restricted,
|
2013-10-23 12:29:20 -05:00
|
|
|
:permission,
|
2014-04-17 04:17:39 -05:00
|
|
|
:parent_category_id,
|
2014-06-27 14:35:25 -05:00
|
|
|
:notification_level,
|
|
|
|
:logo_url,
|
2014-08-12 12:30:28 -05:00
|
|
|
:background_url,
|
|
|
|
:can_edit
|
2013-05-10 01:47:47 -05:00
|
|
|
|
2013-10-23 13:40:39 -05:00
|
|
|
def include_parent_category_id?
|
|
|
|
parent_category_id
|
|
|
|
end
|
2014-06-24 16:27:29 -05:00
|
|
|
|
|
|
|
def description
|
|
|
|
object.uncategorized? ? SiteSetting.uncategorized_description : object.description
|
|
|
|
end
|
2014-08-12 12:30:28 -05:00
|
|
|
|
|
|
|
def can_edit
|
|
|
|
true
|
|
|
|
end
|
|
|
|
def include_can_edit?
|
|
|
|
scope && scope.can_edit?(object)
|
|
|
|
end
|
|
|
|
|
2013-05-10 01:47:47 -05:00
|
|
|
end
|