mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
@@ -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?
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user