FIX: category_list_spec would sometimes fail. It was passing only by luck.

This commit is contained in:
Neil Lalonde 2014-05-21 10:37:37 -04:00
parent 00fefb8e45
commit 68747c8d2d
1 changed files with 2 additions and 0 deletions

View File

@ -57,12 +57,14 @@ class CategoryList
@categories = Category
.includes(:featured_users, subcategories: [:topic_only_relative_url])
.secured(@guardian)
if SiteSetting.fixed_category_positions
@categories = @categories.order('position ASC').order('id ASC')
else
@categories = @categories.order('COALESCE(categories.posts_week, 0) DESC')
.order('COALESCE(categories.posts_month, 0) DESC')
.order('COALESCE(categories.posts_year, 0) DESC')
.order('id ASC')
end
if latest_post_only?