Skip to content

Commit

Permalink
PoC Try to fix scope bug with mobility
Browse files Browse the repository at this point in the history
  • Loading branch information
bricesanchez committed Mar 29, 2018
1 parent ff96277 commit 836e050
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pages/app/models/refinery/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class Page < Core::BaseModel
extend Mobility
translates :title, :menu_title, :custom_slug, :slug, :browser_title, :meta_description

default_scope { i18n }

class Translation
is_seo_meta
end
Expand All @@ -19,14 +21,14 @@ class FriendlyIdOptions
def self.options
# Docs for friendly_id https://github.com/norman/friendly_id
friendly_id_options = {
use: [:reserved],
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[:use] << :mobility
# friendly_id_options[:use] << :mobility
friendly_id_options
end
end
Expand Down

0 comments on commit 836e050

Please sign in to comment.