Class: Renalware::System::Message
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Renalware::System::Message
- Extended by:
- Enumerize
- Defined in:
- app/models/renalware/system/message.rb
Instance Method Summary collapse
-
#active? ⇒ Boolean
Return true if the message should be visible.
Instance Method Details
#active? ⇒ Boolean
Return true if the message should be visible. A message is visible if display_from is in the past and display_until is nil or in the future
26 27 28 29 30 31 32 33 34 |
# File 'app/models/renalware/system/message.rb', line 26 def active? return false if display_from.nil? now = Time.zone.now self.display_until ||= far_future_date return true if display_from < now && display_until > now false end |