convert all emails to lowercase
This commit is contained in:
parent
0f62506a3c
commit
b8a2baf9ac
13
lib/tasks/fix_email_case.rake
Normal file
13
lib/tasks/fix_email_case.rake
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
task fix_email_case: 'gabsocial:fix_email_case'
|
||||||
|
|
||||||
|
namespace :gabsocial do
|
||||||
|
desc 'Convert emails to lowercase'
|
||||||
|
task :fix_email_case => :environment do
|
||||||
|
User.select(:id, :email).all.each do |user|
|
||||||
|
user.update_column :email, user.email.downcase
|
||||||
|
puts(user.id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user