File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,10 @@ class Event < ApplicationRecord
22
22
default_scope -> { where ( label : Whitelabel [ :label_id ] ) }
23
23
24
24
scope :with_topics , -> { joins ( :topics ) . distinct }
25
- scope :current , -> { where ( date : Date . today . to_time ..) . limit ( 1 ) . order ( ' date ASC' ) }
26
- scope :latest , -> { where ( 'date < ?' , Date . today . to_time ) . order ( ' date DESC' ) }
25
+ scope :current , -> { where ( date : Date . today . to_time ..) . limit ( 1 ) . order ( date : :asc ) }
26
+ scope :latest , -> { where ( 'date < ?' , Date . today . to_time ) . order ( date : :desc ) }
27
27
scope :unpublished , -> { where ( 'published IS NULL' ) }
28
- scope :ordered , -> { order ( ' date DESC' ) }
28
+ scope :ordered , -> { order ( date : :desc ) }
29
29
30
30
def end_date
31
31
date + 2 . hours
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ class Highlight < ApplicationRecord
5
5
6
6
default_scope -> { where ( label : Whitelabel [ :label_id ] ) }
7
7
8
- scope :active , -> { where ( 'end_at > ?' , Time . now ) . order ( ' start_at' ) . limit ( 1 ) }
8
+ scope :active , -> { where ( 'end_at > ?' , Time . now ) . order ( start_at : :asc ) . limit ( 1 ) }
9
9
10
10
def disabled?
11
11
end_at <= Time . now
You can’t perform that action at this time.
0 commit comments