Class: Snapshot::Page

Inherits:
ApplicationRecord
  • Object
show all
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

Returns:

  • (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

Returns:

  • (Boolean)


21
22
23
# File 'app/models/postnhost/snapshot/page.rb', line 21

def published?
  true
end

#title_for_metaObject



29
30
31
# File 'app/models/postnhost/snapshot/page.rb', line 29

def title_for_meta
  title_tag.presence || title
end