@@ -29,9 +29,9 @@ def parent_id_cannot_be_this_content
29
29
default_scope { where ( :type => Content . subclasses . collect { |s | s . name } ) unless Rails . env . development? }
30
30
31
31
#Easily query for active, expired, or future content
32
- scope :expired , where ( "end_time < :now" , { :now => Time . now } )
33
- scope :future , where ( "start_time > :now" , { :now => Time . now } )
34
- scope :active , where ( "(start_time IS NULL OR start_time < :now) AND (end_time IS NULL OR end_time > :now)" , { :now => Time . now } )
32
+ scope :expired , where ( "end_time < :now" , { :now => Clock . time } )
33
+ scope :future , where ( "start_time > :now" , { :now => Clock . time } )
34
+ scope :active , where ( "(start_time IS NULL OR start_time < :now) AND (end_time IS NULL OR end_time > :now)" , { :now => Clock . time } )
35
35
36
36
#Scoped relations for feed approval states
37
37
has_many :approved_feeds , :through => :submissions , :source => :feed , :conditions => { "submissions.moderation_flag" => true }
@@ -46,12 +46,12 @@ def parent_id_cannot_be_this_content
46
46
# 1. Start date is before now, or nil.
47
47
# 2. End date is after now, or nil.
48
48
def is_active?
49
- ( start_time . nil? || start_time < Time . now ) && ( end_time . nil? || end_time > Time . now )
49
+ ( start_time . nil? || start_time < Clock . time ) && ( end_time . nil? || end_time > Clock . time )
50
50
end
51
51
52
52
# Determine if content is expired based on its end time.
53
53
def is_expired?
54
- ( end_time < Time . now )
54
+ ( end_time < Clock . time )
55
55
end
56
56
57
57
# Setter for the start time. If a hash is passed, convert that into a DateTime object and then a string.
0 commit comments