From d78489209cf15df2e594f3ee35fa894d731e2ced Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Thu, 12 May 2016 19:53:49 +0800 Subject: [PATCH] sort fix --- app/models/archive_file.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/archive_file.rb b/app/models/archive_file.rb index 117d1c8..42d9544 100644 --- a/app/models/archive_file.rb +++ b/app/models/archive_file.rb @@ -27,7 +27,7 @@ class ArchiveFile field :rss2_sn # scope :can_display,where(is_hidden: false) - scope :can_display, ->{where(is_hidden: false).order_by(:is_top=>-1, :sort_number=>1, :title=>1)} + scope :can_display, ->{where(is_hidden: false).order_by([:is_top, :desc],[:sort_number, :asc])} # belongs_to :archive_file_category