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
- #deleted? ⇒ Boolean
- #draft? ⇒ Boolean
- #flag_as_deleted! ⇒ Object
- #hidden? ⇒ Boolean
- #published? ⇒ Boolean
- #reviewed? ⇒ Boolean
-
#status_label ⇒ Object
Return the status of the page as a string.
Instance Method Details
#deleted? ⇒ Boolean
45 46 47 |
# File 'app/models/concerns/pages_core/page_model/status.rb', line 45 def deleted? status == 4 end |
#draft? ⇒ 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
41 42 43 |
# File 'app/models/concerns/pages_core/page_model/status.rb', line 41 def hidden? status == 3 end |
#published? ⇒ Boolean
37 38 39 |
# File 'app/models/concerns/pages_core/page_model/status.rb', line 37 def published? status == 2 && !autopublish? end |
#reviewed? ⇒ Boolean
33 34 35 |
# File 'app/models/concerns/pages_core/page_model/status.rb', line 33 def reviewed? status == 1 end |
#status_label ⇒ Object
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 |