David May-Miller
1 year ago
committed by
GitHub
1 changed files with 4 additions and 4 deletions
@ -1,19 +1,19 @@ |
|||||||
desc "Squish names of locations, schemes, users, and organisations" |
desc "Squish names of locations, schemes, users, and organisations" |
||||||
task squish_names: :environment do |
task squish_names: :environment do |
||||||
Location.find_each do |location| |
Location.find_each do |location| |
||||||
location.name.squish! |
location.name&.squish! |
||||||
location.save! |
location.save! |
||||||
end |
end |
||||||
Scheme.find_each do |scheme| |
Scheme.find_each do |scheme| |
||||||
scheme.service_name.squish! |
scheme.service_name&.squish! |
||||||
scheme.save! |
scheme.save! |
||||||
end |
end |
||||||
User.find_each do |user| |
User.find_each do |user| |
||||||
user.name.squish! |
user.name&.squish! |
||||||
user.save! |
user.save! |
||||||
end |
end |
||||||
Organisation.find_each do |organisation| |
Organisation.find_each do |organisation| |
||||||
organisation.name.squish! |
organisation.name&.squish! |
||||||
organisation.save! |
organisation.save! |
||||||
end |
end |
||||||
end |
end |
||||||
|
Loading…
Reference in new issue