Class: Locomotive::Page
- Inherits:
-
Object
- Object
- Locomotive::Page
- Includes:
- Extensions::Page::EditableElements, Extensions::Page::Listed, Extensions::Page::Parse, Extensions::Page::Redirect, Extensions::Page::Render, Extensions::Page::Templatized, Extensions::Page::Tree, Extensions::Shared::Seo, Mongoid::Document
- Defined in:
- app/models/locomotive/page.rb
Instance Method Summary collapse
- #default_response_type? ⇒ Boolean
-
#index? ⇒ Boolean
methods ##.
- #index_or_not_found? ⇒ Boolean
-
#latest_updated ⇒ Object
named scopes ##.
- #not_found? ⇒ Boolean
-
#site ⇒ Object
validations ##.
-
#site_id ⇒ Object
indexes ##.
-
#title ⇒ Object
fields ##.
- #translated? ⇒ Boolean
- #translated_in ⇒ Object
- #unpublished? ⇒ Boolean
- #with_cache? ⇒ Boolean
Methods included from Extensions::Page::Templatized
#fetch_target_entry, #target_entry_name, #target_klass, #target_klass_slug, #target_klass_slug=
Methods included from Extensions::Page::Render
Methods included from Extensions::Page::Parse
#force_serialize_template, #template
Methods included from Extensions::Page::EditableElements
#add_or_update_editable_element, #disable_all_editable_elements, #disable_parent_editable_elements, #editable_element_blocks, #editable_elements_grouped_by_blocks, #enable_editable_elements, #enabled_editable_elements, #find_editable_element, #find_editable_elements, #find_editable_files, #merge_editable_elements_from_page, #remove_disabled_editable_elements
Methods included from Extensions::Page::Tree
#children_with_minimal_attributes, #depth, #siblings_and_self_with_scoping, #sort_children!
Instance Method Details
#default_response_type? ⇒ Boolean
80 81 82 |
# File 'app/models/locomotive/page.rb', line 80 def default_response_type? self.response_type == 'text/html' end |
#index? ⇒ Boolean
methods ##
60 61 62 |
# File 'app/models/locomotive/page.rb', line 60 def index? self.slug == 'index' && self.depth.to_i == 0 end |
#index_or_not_found? ⇒ Boolean
72 73 74 |
# File 'app/models/locomotive/page.rb', line 72 def index_or_not_found? self.index? || self.not_found? end |
#latest_updated ⇒ Object
named scopes ##
|
# File 'app/models/locomotive/page.rb', line 49
|
#not_found? ⇒ Boolean
64 65 66 |
# File 'app/models/locomotive/page.rb', line 64 def not_found? self.slug == '404' && self.depth.to_i == 0 end |
#site ⇒ Object
validations ##
28 |
# File 'app/models/locomotive/page.rb', line 28 belongs_to :site, :class_name => 'Locomotive::Site' |
#site_id ⇒ Object
indexes ##
31 |
# File 'app/models/locomotive/page.rb', line 31 index :site_id |
#title ⇒ Object
fields ##
17 |
# File 'app/models/locomotive/page.rb', line 17 field :title, :localize => true |
#translated? ⇒ Boolean
84 85 86 |
# File 'app/models/locomotive/page.rb', line 84 def translated? self.title_translations.key?(::Mongoid::Fields::I18n.locale.to_s) rescue false end |
#translated_in ⇒ Object
88 89 90 |
# File 'app/models/locomotive/page.rb', line 88 def translated_in self.title_translations.keys end |
#unpublished? ⇒ Boolean
68 69 70 |
# File 'app/models/locomotive/page.rb', line 68 def unpublished? !self.published? end |
#with_cache? ⇒ Boolean
76 77 78 |
# File 'app/models/locomotive/page.rb', line 76 def with_cache? self.cache_strategy != 'none' end |