Fix bug.
This commit is contained in:
parent
7711a3183e
commit
0e9168634f
|
@ -19,11 +19,13 @@ class AsksController < ApplicationController
|
|||
else
|
||||
categories = Category.where(:id.in=>OrbitHelper.widget_categories).enabled
|
||||
end
|
||||
unless Category.respond_to?(:sorted)
|
||||
if (module_app.asc rescue true)
|
||||
categories = categories.sort_by{|category| (category.sort_number.to_i rescue category.id)}
|
||||
else
|
||||
categories = categories.sort_by{|category| (-category.sort_number.to_i rescue category.id)}
|
||||
end
|
||||
end
|
||||
tags = module_app.tags
|
||||
ask_question = AskQuestion.new
|
||||
locale = I18n.locale
|
||||
|
@ -132,11 +134,13 @@ class AsksController < ApplicationController
|
|||
else
|
||||
categories = Category.where(:id.in=>OrbitHelper.page_categories).enabled
|
||||
end
|
||||
unless Category.respond_to?(:sorted)
|
||||
if (module_app.asc rescue true)
|
||||
categories = categories.sort_by{|category| (category.sort_number.to_i rescue category.id)}
|
||||
else
|
||||
categories = categories.sort_by{|category| (-category.sort_number.to_i rescue category.id)}
|
||||
end
|
||||
end
|
||||
category_ids = categories.collect{|v| v.id.to_s}
|
||||
ask_settings = AskCategorySetting.enabled.where(:category_id.in=> category_ids).to_a
|
||||
first_category_id = category_ids.first
|
||||
|
|
Loading…
Reference in New Issue