Sha256: c453bdb376ff0338c9659b645a3eb1c19a5fb5e0e1db7960cbaeedea04cfbc0b
Contents?: true
Size: 539 Bytes
Versions: 36
Compression:
Stored size: 539 Bytes
Contents
require 'chronic_duration' module Perus::Server class ActiveAlert < Sequel::Model many_to_one :alert many_to_one :system def severity alert.severity end def active_for ChronicDuration.output(Time.now.to_i - timestamp, format: :short) end def self.add(alert, system) ActiveAlert.create( system_id: system.id, alert_id: alert.id, timestamp: Time.now.to_i ) end end end
Version data entries
36 entries across 36 versions & 1 rubygems