From d765e09859e719aee2ea5d0ee2d7514514a36191 Mon Sep 17 00:00:00 2001 From: David Warburton Date: Mon, 15 Nov 2021 13:56:05 -0500 Subject: [PATCH] Don't modify source column --- lib/slug/slug.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/slug/slug.rb b/lib/slug/slug.rb index 23aa38e..3627396 100644 --- a/lib/slug/slug.rb +++ b/lib/slug/slug.rb @@ -80,8 +80,10 @@ def validate_slug_columns # Feel free to override this method if you'd like different slug formatting. def normalize_slug(str) return if str.blank? - str.gsub!(/[\p{Pc}\p{Ps}\p{Pe}\p{Pi}\p{Pf}\p{Po}]/, '') # Remove punctuation - str.parameterize + # Remove punctuation + str + .gsub(/[\p{Pc}\p{Ps}\p{Pe}\p{Pi}\p{Pf}\p{Po}]/, '') + .parameterize end # If a slug of the same name already exists, this will append '-n' to the end of the slug to