Fix category ordering on categories page. I broke it.
This commit is contained in:
parent
b41ee7256e
commit
50bd05663c
|
@ -56,16 +56,17 @@ class CategoryList
|
|||
@categories = Category
|
||||
.includes(:featured_users)
|
||||
.secured(@guardian)
|
||||
.order('position ASC')
|
||||
|
||||
if latest_post_only?
|
||||
@categories = @categories
|
||||
.includes(:latest_post => {:topic => :last_poster} )
|
||||
.order('position ASC')
|
||||
else
|
||||
@categories = @categories
|
||||
.order('COALESCE(categories.topics_week, 0) DESC')
|
||||
.order('COALESCE(categories.topics_month, 0) DESC')
|
||||
.order('COALESCE(categories.topics_year, 0) DESC')
|
||||
@categories = @categories.includes(:latest_post => {:topic => :last_poster} )
|
||||
# else
|
||||
# # This is only for the old 2-column layout.
|
||||
# # Use this when we support "organic" positioning of some/all categories.
|
||||
# @categories = @categories
|
||||
# .order('COALESCE(categories.topics_week, 0) DESC')
|
||||
# .order('COALESCE(categories.topics_month, 0) DESC')
|
||||
# .order('COALESCE(categories.topics_year, 0) DESC')
|
||||
end
|
||||
|
||||
@categories = @categories.to_a
|
||||
|
|
Loading…
Reference in New Issue