lib/ardb/has_slug.rb in ardb-0.27.1 vs lib/ardb/has_slug.rb in ardb-0.27.2

- old
+ new

@@ -84,10 +84,10 @@ preprocessor = options[:preprocessor] separator = options[:separator] allow_underscores = options[:allow_underscores] regexp_escaped_sep = Regexp.escape(separator) - slug = preprocessor.call(string.to_s) + slug = preprocessor.call(string.to_s.dup) # Turn unwanted chars into the separator slug.gsub!(/[^\w#{regexp_escaped_sep}]+/, separator) # Turn underscores into the separator, unless allowing slug.gsub!(/_/, separator) unless allow_underscores # No more than one of the separator in a row.