Module: Mongoid::Translate::Slug
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/mongoid/translate/slug.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#to_slug ⇒ String
Return slug.
Instance Method Details
#to_slug ⇒ String
Return slug. Didn’t want to mess with to_param.
24 25 26 27 |
# File 'lib/mongoid/translate/slug.rb', line 24 def to_slug locale = languages.include?(I18n.locale) ? I18n.locale : main_language translations.where(language: locale).one.slug end |