Class: Refinery::Page::FriendlyIdOptions

Inherits:
Object
  • Object
show all
Defined in:
pages/app/models/refinery/page.rb

Class Method Summary collapse

Class Method Details

.optionsObject



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'pages/app/models/refinery/page.rb', line 22

def self.options
  # Docs for friendly_id https://github.com/norman/friendly_id
  friendly_id_options = {
    use: [:reserved],
    reserved_words: Refinery::Pages.friendly_id_reserved_words
  }
  if ::Refinery::Pages.scope_slug_by_parent
    friendly_id_options[:use] << :scoped
    friendly_id_options.merge!(scope: :parent)
  end
  friendly_id_options[:use] << :globalize
  friendly_id_options
end