Class: Snapshot::Page
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- Snapshot::Page
- Defined in:
- app/models/postnhost/snapshot/page.rb
Constant Summary collapse
- SCALAR_ATTRIBUTES =
%i[language_id title title_tag og_title meta_description content slug].freeze
Instance Method Summary collapse
Instance Method Details
#differs_from?(draft) ⇒ Boolean
25 26 27 |
# File 'app/models/postnhost/snapshot/page.rb', line 25 def differs_from?(draft) SCALAR_ATTRIBUTES.any? { |attribute| public_send(attribute) != draft.public_send(attribute) } end |
#published? ⇒ Boolean
21 22 23 |
# File 'app/models/postnhost/snapshot/page.rb', line 21 def published? true end |
#title_for_meta ⇒ Object
29 30 31 |
# File 'app/models/postnhost/snapshot/page.rb', line 29 def title_tag.presence || title end |