Module: SimplePages::Models::PageLocale

Extended by:
ActiveSupport::Concern
Defined in:
lib/simple_pages/models/page_locale.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

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



20
21
22
23
24
25
# File 'lib/simple_pages/models/page_locale.rb', line 20

def set_as_localized(locale = ::I18n.locale)
  return if locale.to_s == 'en'
  unless url =~ /#{locale.to_s.downcase}$/
    self.url += "-#{locale.to_s}"
  end
end