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


35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'pages/app/models/refinery/page.rb', line 35

def self.options
  # Docs for friendly_id https://github.com/norman/friendly_id
  friendly_id_options = {
    use: [:mobility, :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
end