Module: Mongoid::Translation::Slug
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/mongoid/translation/slug.rb
Instance Method Summary collapse
-
#set_slug ⇒ Object
Slug creation.
Instance Method Details
#set_slug ⇒ Object
Slug creation.
19 20 21 22 23 24 25 26 27 |
# File 'lib/mongoid/translation/slug.rb', line 19 def set_slug if self.slug.blank? && slugged_field.present? if translation_parent_class.send(:by_slug, slugged).one self.slug = slugged_with_token else self.slug = slugged end end end |