Fix for loading uncategorized topics when slug for uncategorized_name is blank

This commit is contained in:
Neil Lalonde 2013-04-18 16:28:47 -04:00
parent 5cd6c85e8b
commit f76d6c0f3f

View file

@ -32,7 +32,7 @@ class ListController < ApplicationController
list = nil list = nil
# If they choose uncategorized, return topics NOT in a category # If they choose uncategorized, return topics NOT in a category
if params[:category] == Slug.for(SiteSetting.uncategorized_name) || params[:category] == SiteSetting.uncategorized_name if params[:category] == Slug.for(SiteSetting.uncategorized_name) or params[:category] == SiteSetting.uncategorized_name or params[:category] == 'null-category'
list = query.list_uncategorized list = query.list_uncategorized
else else
@category = Category.where("slug = ? or id = ?", params[:category], params[:category].to_i).includes(:featured_users).first @category = Category.where("slug = ? or id = ?", params[:category], params[:category].to_i).includes(:featured_users).first