FIX: category_list_spec would sometimes fail. It was passing only by luck.
This commit is contained in:
parent
00fefb8e45
commit
68747c8d2d
|
@ -57,12 +57,14 @@ class CategoryList
|
||||||
@categories = Category
|
@categories = Category
|
||||||
.includes(:featured_users, subcategories: [:topic_only_relative_url])
|
.includes(:featured_users, subcategories: [:topic_only_relative_url])
|
||||||
.secured(@guardian)
|
.secured(@guardian)
|
||||||
|
|
||||||
if SiteSetting.fixed_category_positions
|
if SiteSetting.fixed_category_positions
|
||||||
@categories = @categories.order('position ASC').order('id ASC')
|
@categories = @categories.order('position ASC').order('id ASC')
|
||||||
else
|
else
|
||||||
@categories = @categories.order('COALESCE(categories.posts_week, 0) DESC')
|
@categories = @categories.order('COALESCE(categories.posts_week, 0) DESC')
|
||||||
.order('COALESCE(categories.posts_month, 0) DESC')
|
.order('COALESCE(categories.posts_month, 0) DESC')
|
||||||
.order('COALESCE(categories.posts_year, 0) DESC')
|
.order('COALESCE(categories.posts_year, 0) DESC')
|
||||||
|
.order('id ASC')
|
||||||
end
|
end
|
||||||
|
|
||||||
if latest_post_only?
|
if latest_post_only?
|
||||||
|
|
Loading…
Reference in New Issue