happening now - model implementation
This commit is contained in:
parent
157924803c
commit
51f9ba0206
2 changed files with 14 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
##
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue