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)

43
44
45
# File 'app/models/concerns/pages_core/page_model/status.rb', line 43

def deleted?
  status == 4
end

#draft?Boolean

Returns:

  • (Boolean)

27
28
29
# File 'app/models/concerns/pages_core/page_model/status.rb', line 27

def draft?
  status.zero?
end

#flag_as_deleted!Object


23
24
25
# File 'app/models/concerns/pages_core/page_model/status.rb', line 23

def flag_as_deleted!
  update(status: 4)
end

#hidden?Boolean

Returns:

  • (Boolean)

39
40
41
# File 'app/models/concerns/pages_core/page_model/status.rb', line 39

def hidden?
  status == 3
end

#published?Boolean

Returns:

  • (Boolean)

35
36
37
# File 'app/models/concerns/pages_core/page_model/status.rb', line 35

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

#reviewed?Boolean

Returns:

  • (Boolean)

31
32
33
# File 'app/models/concerns/pages_core/page_model/status.rb', line 31

def reviewed?
  status == 1
end

#status_labelObject

Return the status of the page as a string


19
20
21
# File 'app/models/concerns/pages_core/page_model/status.rb', line 19

def status_label
  self.class.status_labels[status]
end