From f9621202070c84d194337b296dcfea1e8af5e2e4 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Thu, 8 Oct 2015 17:04:54 +0800 Subject: [PATCH] small fix for order --- app/models/bulletin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/bulletin.rb b/app/models/bulletin.rb index fcfee99..2f5416b 100644 --- a/app/models/bulletin.rb +++ b/app/models/bulletin.rb @@ -39,7 +39,7 @@ class Bulletin before_destroy :destroy_email - scope :can_display, ->{where(:is_hidden=>false,:is_preview => false).any_of({:postdate.lt=>Time.now, :deadline.gt=>Time.now},{:postdate.lt=>Time.now, :deadline=>nil}).order_by([:is_top, :desc],[:postdate, :desc])} + scope :can_display, ->{where(:is_hidden=>false,:is_preview => false).any_of({:postdate.lt=>Time.now, :deadline.gt=>Time.now},{:postdate.lt=>Time.now, :deadline=>nil}).order_by([:postdate, :desc], [:is_top, :desc])} scope :is_approved, ->{where(:approved => true)} before_create :set_expire