Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Instead of the standard composition, convert everything
- # non-alpha and non-digit to dash and squeeze
- class String
- def identify
- if Mongoid.parameterize_keys
- gsub(/[^a-z0-9]+/, ' ').strip.gsub(' ', '-')
- else
- self
- end
- end
- end
Add Comment
Please, Sign In to add comment