Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # in /config/initializers/friendly_id.rb
- module FrieldlyId
- module Slugged
- def resolve_friendly_id_conflict(candidates)
- my_cool_unique_suffix = SecureRandom.hex(4) # some shorter suffix
- candidates.first + friendly_id_config.sequence_separator + my_cool_unique_suffix
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement