[fix] Fix style; Fix start_hour and end_hour in test
This commit is contained in:
parent
85fe894876
commit
39d4960b69
3 changed files with 3 additions and 2 deletions
|
|
@ -56,6 +56,7 @@ class EventSchedule < ApplicationRecord
|
|||
#
|
||||
def happening_now?(threshold = 30.minutes)
|
||||
return false if end_time < Time.now
|
||||
|
||||
event_time_range = start_time..end_time
|
||||
now_range = (Time.now - threshold)..(Time.now + threshold)
|
||||
event_time_range.overlaps?(now_range)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue