added task users:fix_corrupted_country_codes
This commit is contained in:
parent
631899007e
commit
932513a00b
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue