mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: category_list_spec would sometimes fail. It was passing only by luck.
This commit is contained in:
parent
00fefb8e45
commit
68747c8d2d
1 changed files with 2 additions and 0 deletions
|
@ -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?
|
||||
|
|
Loading…
Reference in a new issue