Use the correct Unicode character in MarkAsDeletedWithName

This commit is contained in:
Patrick Gansterer 2020-07-30 22:05:19 +02:00
parent 6b400b4f96
commit d52315287d
2 changed files with 7 additions and 1 deletions

View file

@ -11,7 +11,7 @@ module MarkAsDeletedWithName
# (would have been nice to use retry, but there is no general duplicate-entry exception)
n = ''
begin
append = ' \u2020' + n
append = " \u2020" + n
deleted_name = name.truncate(max_length-append.length, omission: '') + append
if n.blank?
n = 'A'

View file

@ -0,0 +1,6 @@
class ChangeMarkedAsDeletedNames < ActiveRecord::Migration
def up
execute "UPDATE groups SET name = REPLACE(name, '\\u2020', '\u2020') WHERE deleted_at IS NOT NULL"
execute "UPDATE suppliers SET name = REPLACE(name, '\\u2020', '\u2020') WHERE deleted_at IS NOT NULL"
end
end