Module: Archangel::Models::PublishableConcern
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/models/concerns/archangel/models/publishable_concern.rb
Overview
Model publish concern
Instance Method Summary collapse
-
#available? ⇒ Boolean
Check if resource is currently available.
-
#published? ⇒ Boolean
Check if resource is published.
Instance Method Details
#available? ⇒ Boolean
Check if resource is currently available.
This will return true if there is a published date and it is in the past. Future publication date will return false.
52 53 54 |
# File 'app/models/concerns/archangel/models/publishable_concern.rb', line 52 def available? published? && published_at <= Time.current end |
#published? ⇒ Boolean
Check if resource is published.
Future publication date is also considered published. This will return true if there is any published date avaialable; past and future.
40 41 42 |
# File 'app/models/concerns/archangel/models/publishable_concern.rb', line 40 def published? published_at.present? end |