add join before mb_chars

parent 241ac29b
Pipeline #902 canceled with stages
in 0 seconds
......@@ -3,7 +3,6 @@ class ApplicationRecord < ActiveRecord::Base
def convert_attribute(val)
return '' if val.blank?
[val, rand(10000)].mb_chars.normalize(:kd).gsub(/[Đđ]/, 'd').gsub(/[^\x00-\x7F]/,'').gsub(/[\W+]/,' ').downcase.to_s.split(' ').join('-')
[val, rand(10000)].join.mb_chars.normalize(:kd).gsub(/[Đđ]/, 'd').gsub(/[^\x00-\x7F]/,'').gsub(/[\W+]/,' ').downcase.to_s.split(' ').join('-')
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment