Module: ActivePermalink::Sluggable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/active_permalink/sluggable.rb
Instance Method Summary collapse
- #found_by_slug ⇒ Object
- #found_by_slug=(value) ⇒ Object
- #found_by_slug? ⇒ Boolean
- #needs_redirect? ⇒ Boolean
- #old_slugs ⇒ Object
Instance Method Details
#found_by_slug ⇒ Object
28 29 30 |
# File 'lib/active_permalink/sluggable.rb', line 28 def found_by_slug @found_by_slug end |
#found_by_slug=(value) ⇒ Object
32 33 34 |
# File 'lib/active_permalink/sluggable.rb', line 32 def found_by_slug=(value) @found_by_slug = value end |
#found_by_slug? ⇒ Boolean
36 37 38 |
# File 'lib/active_permalink/sluggable.rb', line 36 def found_by_slug? !found_by_slug.nil? end |
#needs_redirect? ⇒ Boolean
40 41 42 |
# File 'lib/active_permalink/sluggable.rb', line 40 def needs_redirect? found_by_slug? and found_by_slug != slug end |
#old_slugs ⇒ Object
44 45 46 |
# File 'lib/active_permalink/sluggable.rb', line 44 def old_slugs @old_slugs ||= old_permalinks.pluck(:slug) end |