small fix for sorting

This commit is contained in:
Harry Bomrah 2016-05-12 19:56:34 +08:00
parent d78489209c
commit 01e55c7eea
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@ class ArchivesController < ApplicationController
page.save
end
end
files_by_cateogry = ArchiveFile.can_display.filter_by_categories.filter_by_tags.group_by(&:category)
files_by_cateogry = ArchiveFile.where(is_hidden: false).filter_by_categories.filter_by_tags.order_by([:is_top, :desc],[:sort_number, :asc]).group_by(&:category)
categories = files_by_cateogry.keys
cats = categories.collect do |category|
url_to_edit = OrbitHelper.user_has_cateogry?(category) ? "/admin/archive_files?filters[category][]=#{category.id.to_s}" : ""