Skip to content

Commit

Permalink
Anonymise customer first and last names
Browse files Browse the repository at this point in the history
These were added a couple of years ago in #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: #8835
  • Loading branch information
dacook committed Sep 16, 2024
1 parent 6849155 commit 9c51615
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/tasks/data/anonymize_data.rake
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ namespace :ofn do
unconfirmed_email = concat(id, '[email protected]')")
Customer.where(user_id: nil)
.update_all("email = concat(id, '[email protected]'),
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, '[email protected]'),
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, '[email protected]')")
end
Expand Down

0 comments on commit 9c51615

Please sign in to comment.