change it so all topics MUST include a category, we store a special uncategorized category to compensate

this cleans up a bunch of internals and removes some settings
This commit is contained in:
Sam
2013-10-24 10:05:51 +11:00
parent 6f66d4876a
commit 666264879c
63 changed files with 183 additions and 369 deletions

View File

@@ -23,7 +23,7 @@ class CategoryDetailedSerializer < BasicCategorySerializer
end
def is_uncategorized
name == SiteSetting.uncategorized_name
object.id == SiteSetting.uncategorized_category_id
end
def include_is_uncategorized?

View File

@@ -3,8 +3,8 @@ class SiteSerializer < ApplicationSerializer
attributes :default_archetype,
:notification_types,
:post_types,
:uncategorized_slug,
:group_names
:group_names,
:uncategorized_category_id # this is hidden so putting it here
has_many :categories, serializer: BasicCategorySerializer, embed: :objects
@@ -21,8 +21,8 @@ class SiteSerializer < ApplicationSerializer
Post.types
end
def uncategorized_slug
Slug.for(SiteSetting.uncategorized_name)
def uncategorized_category_id
SiteSetting.uncategorized_category_id
end
end