From e4bf6f288687319d50697a88d2b102265a393225 Mon Sep 17 00:00:00 2001 From: David May-Miller Date: Wed, 25 Oct 2023 09:54:31 +0100 Subject: [PATCH] CLDC-2895 Add rake task to squish the names of all locations, schemes, users, and organisations --- lib/tasks/squish_names.rake | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lib/tasks/squish_names.rake diff --git a/lib/tasks/squish_names.rake b/lib/tasks/squish_names.rake new file mode 100644 index 000000000..3fe3da2e9 --- /dev/null +++ b/lib/tasks/squish_names.rake @@ -0,0 +1,19 @@ +desc "Squish names of locations, schemes, users, and organisations" +task squish_names: :environment do + Location.find_each do |location| + location.name.squish! + location.save! + end + Scheme.find_each do |scheme| + scheme.service_name.squish! + scheme.save! + end + User.find_each do |user| + user.name.squish! + user.save! + end + Organisation.find_each do |organisation| + organisation.name.squish! + organisation.save! + end +end