Class: Downtime

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
app/models/downtime.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.for(artefact) ⇒ Object



15
16
17
# File 'app/models/downtime.rb', line 15

def self.for(artefact)
  where(artefact_id: artefact.id).first
end

Instance Method Details

#display_start_timeObject



23
24
25
# File 'app/models/downtime.rb', line 23

def display_start_time
  start_time.yesterday.at_midnight
end

#publicise?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/models/downtime.rb', line 19

def publicise?
  Time.zone.now.between?(display_start_time, end_time)
end