Fix the wrong display order problem in index page when postdate are equal.
This commit is contained in:
parent
0944cd8777
commit
38022023e0
|
@ -50,7 +50,7 @@ class Bulletin
|
|||
|
||||
before_destroy :destroy_email
|
||||
|
||||
scope :can_display_and_sorted, ->{where(:is_hidden=>false,:is_preview => false).any_of({:postdate.lte=>Time.now, :deadline.gte=>Time.now},{:postdate.lte=>Time.now, :deadline=>nil}).order(is_top: :desc,postdate: :desc)}
|
||||
scope :can_display_and_sorted, ->{where(:is_hidden=>false,:is_preview => false).any_of({:postdate.lte=>Time.now, :deadline.gte=>Time.now},{:postdate.lte=>Time.now, :deadline=>nil}).order(is_top: :desc,postdate: :desc,id: :desc)}
|
||||
scope :is_approved, ->{where(:approved => true)}
|
||||
|
||||
before_create :set_expire
|
||||
|
|
Loading…
Reference in New Issue