FIX: Couldn't access "Uncategorized" category from category list.

This commit is contained in:
Robin Ward
2013-05-27 14:15:20 -04:00
parent b1ef2ea1e1
commit 62a20f5655
10 changed files with 82 additions and 43 deletions

View File

@@ -9,7 +9,8 @@ class CategoryDetailedSerializer < ApplicationSerializer
:topics_week,
:topics_month,
:topics_year,
:description
:description,
:is_uncategorized
has_many :featured_users, serializer: BasicUserSerializer
has_many :featured_topics, serializer: CategoryTopicSerializer, embed: :objects, key: :topics
@@ -26,4 +27,12 @@ class CategoryDetailedSerializer < ApplicationSerializer
object.topics_year || 0
end
def is_uncategorized
name == SiteSetting.uncategorized_name
end
def include_is_uncategorized?
is_uncategorized
end
end

View File

@@ -2,7 +2,8 @@ class SiteSerializer < ApplicationSerializer
attributes :default_archetype,
:notification_types,
:post_types
:post_types,
:uncategorized_slug
has_many :categories, serializer: BasicCategorySerializer, embed: :objects
has_many :post_action_types, embed: :objects
@@ -18,4 +19,8 @@ class SiteSerializer < ApplicationSerializer
Post.types
end
def uncategorized_slug
Slug.for(SiteSetting.uncategorized_name)
end
end