Fix NoMethodError: undefined method `default_order' for ActiveRecord::Relation
This commit is contained in:
parent
b20c533e6b
commit
05eac4918f
|
@ -19,10 +19,10 @@ class CategoriesController < ApplicationController
|
||||||
if @platform
|
if @platform
|
||||||
@categories = Category.select('categories.id, categories.name, categories.ancestry, count(projects.id) projects_count').
|
@categories = Category.select('categories.id, categories.name, categories.ancestry, count(projects.id) projects_count').
|
||||||
joins(:projects => :repositories).where('repositories.platform_id = ?', @platform.id).
|
joins(:projects => :repositories).where('repositories.platform_id = ?', @platform.id).
|
||||||
having('count(projects.id) > 0').group('categories.id, categories.name, categories.ancestry, projects_count').default_order
|
having('count(projects.id) > 0').group('categories.id, categories.name, categories.ancestry, projects_count')
|
||||||
render 'index2'
|
render 'index2'
|
||||||
else
|
else
|
||||||
@categories = Category.default_order.paginate(:page => params[:page])
|
@categories = Category.paginate(:page => params[:page])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue