Module: PagesCore::PageModel::Status

Extended by:
ActiveSupport::Concern
Included in:
Page
Defined in:
app/models/concerns/pages_core/page_model/status.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#deleted?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'app/models/concerns/pages_core/page_model/status.rb', line 45

def deleted?
  status == 4
end

#draft?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'app/models/concerns/pages_core/page_model/status.rb', line 29

def draft?
  status.zero?
end

#flag_as_deleted!Object



25
26
27
# File 'app/models/concerns/pages_core/page_model/status.rb', line 25

def flag_as_deleted!
  update(status: 4)
end

#hidden?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'app/models/concerns/pages_core/page_model/status.rb', line 41

def hidden?
  status == 3
end

#published?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'app/models/concerns/pages_core/page_model/status.rb', line 37

def published?
  status == 2 && !autopublish?
end

#reviewed?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'app/models/concerns/pages_core/page_model/status.rb', line 33

def reviewed?
  status == 1
end

#status_labelObject

Return the status of the page as a string



21
22
23
# File 'app/models/concerns/pages_core/page_model/status.rb', line 21

def status_label
  self.class.status_labels[status]
end