Class: Postnhost::Page

Inherits:
ApplicationRecord show all
Includes:
ImageUploadable, PrimaryLanguageGuard
Defined in:
app/models/postnhost/page.rb

Defined Under Namespace

Modules: ImageUploadable

Constant Summary

Constants included from InlineImageUploadable

InlineImageUploadable::IMAGE_MAX_SIZE, InlineImageUploadable::SUPPORTED_CONTENT_TYPES

Instance Method Summary collapse

Methods included from InlineImageUploadable

#upload_inline_image

Instance Method Details

#published?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'app/models/postnhost/page.rb', line 25

def published?
  page_snapshot.present?
end

#title_for_metaObject



33
34
35
# File 'app/models/postnhost/page.rb', line 33

def title_for_meta
  title_tag.presence || title
end

#unpublished_changes?Boolean

Returns:

  • (Boolean)


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

def unpublished_changes?
  page_snapshot&.differs_from?(self) || false
end