diff --git a/web/lib/tasks/users.rake b/web/lib/tasks/users.rake index 7390f1334..b84af130e 100644 --- a/web/lib/tasks/users.rake +++ b/web/lib/tasks/users.rake @@ -6,4 +6,13 @@ namespace :users do User.deliver_new_musician_notifications(since_date) end + desc "Fix corrupted country codes" + task :fix_corrupted_country_codes do |task, args| + User.where(["country like ?","{:country%"]).find_each do |uu| + if uu.country =~ /{:countrycode=>"([A-Z]+)",/ + uu.update_attribute(:country,$1) + end + end + end + end