Class: Maglev::Page

Inherits:
ApplicationRecord show all
Includes:
PathConcern, SearchConcern, SectionsConcern, Translatable
Defined in:
app/models/maglev/page.rb

Defined Under Namespace

Modules: PathConcern, SearchConcern

Instance Method Summary collapse

Methods included from PathConcern

#current_path, #default_path, #disable_spawn_redirection, #path, #path=, #path_hash, #spawn_redirection_disabled?

Methods included from SectionsConcern

#prepare_sections, #prepare_sections_translations

Methods included from Translatable

#translations_for

Instance Method Details

#homeObject

scopes ##



18
# File 'app/models/maglev/page.rb', line 18

scope :home, ->(locale = nil) { by_path('index', locale) }

#index?Boolean

methods ##

Returns:

  • (Boolean)


30
31
32
# File 'app/models/maglev/page.rb', line 30

def index?
  path == 'index'
end

#static?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'app/models/maglev/page.rb', line 34

def static?
  false
end

#titleObject

translations ##



12
# File 'app/models/maglev/page.rb', line 12

translates :title, presence: true