Module: ManualSlug::Mongoid
- Extended by:
- ActiveSupport::Concern
- Includes:
- Mongoid::Slug
- Included in:
- ManualSlug
- Defined in:
- lib/manual_slug/mongoid.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#text_slug ⇒ Object
5 6 7 |
# File 'lib/manual_slug/mongoid.rb', line 5 def text_slug ((self._slugs.nil? or self._slugs.empty?) ? '' : self._slugs.last) end |
#text_slug=(slug) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/manual_slug/mongoid.rb', line 8 def text_slug=(slug) self._slugs ||= [] if slug.blank? self._slugs = [] else self._slugs.delete(slug) self._slugs << slug end end |