Module: Pageflow::EntryPublicationStates
- Extended by:
- ActiveSupport::Concern
- Included in:
- Entry
- Defined in:
- app/models/concerns/pageflow/entry_publication_states.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #publication_state ⇒ Object
- #published? ⇒ Boolean
- #published_at ⇒ Object
- #published_until ⇒ Object
- #published_with_password_protection? ⇒ Boolean
Instance Method Details
#publication_state ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'app/models/concerns/pageflow/entry_publication_states.rb', line 22 def publication_state if published_with_password_protection? 'published_with_password_protection' elsif published? 'published_without_password_protection' else 'not_published' end end |
#published? ⇒ Boolean
36 37 38 |
# File 'app/models/concerns/pageflow/entry_publication_states.rb', line 36 def published? published_revision.present? end |
#published_at ⇒ Object
40 41 42 |
# File 'app/models/concerns/pageflow/entry_publication_states.rb', line 40 def published_at published? ? published_revision.published_at : nil end |
#published_until ⇒ Object
44 45 46 |
# File 'app/models/concerns/pageflow/entry_publication_states.rb', line 44 def published_until published? ? published_revision.published_until : nil end |
#published_with_password_protection? ⇒ Boolean
32 33 34 |
# File 'app/models/concerns/pageflow/entry_publication_states.rb', line 32 def published_with_password_protection? published? && published_revision.password_protected? end |