Class: Archangel::Entry

Inherits:
ApplicationRecord show all
Defined in:
app/models/archangel/entry.rb

Overview

Entry model

Instance Method Summary collapse

Instance Method Details

#available?Boolean

Check if Entry 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


42
43
44
# File 'app/models/archangel/entry.rb', line 42

def available?
  published? && published_at <= Time.now
end

#published?Boolean

Check if Entry 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:


56
57
58
# File 'app/models/archangel/entry.rb', line 56

def published?
  published_at.present?
end