Change sort to use event_date.
This commit is contained in:
parent
1717bd6d27
commit
53df1ff3a4
|
@ -65,7 +65,7 @@ class EventNews
|
||||||
|
|
||||||
before_destroy :destroy_email
|
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,id: :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,event_date: :desc,id: :desc)}
|
||||||
scope :is_approved, ->{where(:approved => true)}
|
scope :is_approved, ->{where(:approved => true)}
|
||||||
|
|
||||||
before_create :set_expire
|
before_create :set_expire
|
||||||
|
|
Loading…
Reference in New Issue