Browse Source

CLDC-2895 Add safe navigation operator to entity name updates (#2008)

Since name can be nil.
pull/1997/head
David May-Miller 1 year ago committed by GitHub
parent
commit
3436c87d26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      lib/tasks/squish_names.rake

8
lib/tasks/squish_names.rake

@ -1,19 +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.name&.squish!
location.save!
end
Scheme.find_each do |scheme|
scheme.service_name.squish!
scheme.service_name&.squish!
scheme.save!
end
User.find_each do |user|
user.name.squish!
user.name&.squish!
user.save!
end
Organisation.find_each do |organisation|
organisation.name.squish!
organisation.name&.squish!
organisation.save!
end
end

Loading…
Cancel
Save