Module: Archangel::Models::PublishableConcern

Extended by:
ActiveSupport::Concern
Included in:
Entry, Page
Defined in:
app/models/concerns/archangel/models/publishable_concern.rb

Overview

Model publish concern

Instance Method Summary collapse

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.

Returns:

  • (Boolean)

    if available



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.

Returns:

  • (Boolean)

    if published

See Also:

  • Archangel::Models::PublishableConcern.resourceresource.available?


40
41
42
# File 'app/models/concerns/archangel/models/publishable_concern.rb', line 40

def published?
  published_at.present?
end