happening now - model implementation

This commit is contained in:
rajavi-mishra 2021-03-12 09:51:24 -08:00
parent 157924803c
commit 51f9ba0206
2 changed files with 14 additions and 1 deletions

View file

@ -7,7 +7,6 @@
# id :bigint not null, primary key
# abstract :text
# comments_count :integer default(0), not null
# committee_review :text
# description :text
# guid :string not null
# is_highlight :boolean default(FALSE)
@ -338,6 +337,10 @@ class Event < ApplicationRecord
time <=> other.time
end
def is_live?
start_time >= Time.now && Time.now <= start_time + event_type.length
end
private
##