mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-21 05:09:15 +00:00
Anonymise customer first and last names
These were added a couple of years ago in https://github.com/openfoodfoundation/openfoodnetwork/pull/8763 But I guess we never noticed the names weren't getting anonymised. The old 'name' field is still in the DB. It was kept for compatibility during migraiton but never cleaned up. I've added the tech debt task to the welcome new devs board now: https://github.com/openfoodfoundation/openfoodnetwork/issues/8835
This commit is contained in:
@@ -46,10 +46,14 @@ namespace :ofn do
|
||||
unconfirmed_email = concat(id, '_ofn_user@example.com')")
|
||||
Customer.where(user_id: nil)
|
||||
.update_all("email = concat(id, '_ofn_customer@example.com'),
|
||||
name = concat('Customer Number ', id, ' (without connected User)')")
|
||||
name = concat('Customer Number ', id, ' (without connected User)'),
|
||||
first_name = concat('Customer Number ', id),
|
||||
last_name = '(without connected User)'")
|
||||
Customer.where.not(user_id: nil)
|
||||
.update_all("email = concat(user_id, '_ofn_user@example.com'),
|
||||
name = concat('Customer Number ', id, ' - User ', user_id)")
|
||||
name = concat('Customer Number ', id, ' - User ', user_id),
|
||||
first_name = concat('Customer Number ', id),
|
||||
last_name = concat('User ', user_id)")
|
||||
|
||||
Spree::Order.update_all("email = concat(id, '_ofn_order@example.com')")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user