Class: Archangel::Entry
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Archangel::Entry
- Defined in:
- app/models/archangel/entry.rb
Overview
Entry model
Instance Method Summary collapse
-
#available? ⇒ Boolean
Check if Entry is available.
-
#status ⇒ String
Return string of availability status.
Instance Method Details
#available? ⇒ Boolean
Check if Entry is available. Available in the past, present and future. Future availability date is also considered available.
28 29 30 |
# File 'app/models/archangel/entry.rb', line 28 def available? available_at.present? end |
#status ⇒ String
Return string of availability status.
37 38 39 40 41 42 43 44 45 46 47 |
# File 'app/models/archangel/entry.rb', line 37 def status if available? if available_at > Time.now "future-available" else "available" end else "unavailable" end end |