Module: SimplePages::Models::PageLocale::ClassMethods

Defined in:
lib/simple_pages/models/page_locale.rb

Instance Method Summary collapse

Instance Method Details

#localized(locale = ::I18n.locale) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/simple_pages/models/page_locale.rb', line 11

def localized(locale = ::I18n.locale)
  if locale.to_s == 'en'
    scoped
  else
    where('url LIKE ?', "%-#{locale.to_s.downcase}")
  end
end