diff --git a/app/models/event_news.rb b/app/models/event_news.rb index e7f187a..47b443b 100644 --- a/app/models/event_news.rb +++ b/app/models/event_news.rb @@ -65,7 +65,7 @@ class EventNews 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)} before_create :set_expire