2018-02-28 16:59:50 +01:00
|
|
|
|
namespace :'2018_02_28_clean_invalid_emails_accounts' do
|
|
|
|
|
task clean: :environment do
|
2019-09-12 11:26:22 +02:00
|
|
|
|
Gestionnaire.pluck(:email, :id).filter { |e, _id| e.include?(" ") }.each do |_email, id|
|
2018-05-30 18:45:46 +02:00
|
|
|
|
Gestionnaire.find_by(id: id, current_sign_in_at: nil)&.destroy # ensure account was never used
|
2018-02-28 16:59:50 +01:00
|
|
|
|
end
|
|
|
|
|
|
2019-09-12 11:26:22 +02:00
|
|
|
|
User.pluck(:email, :id).filter { |e, _id| e.include?(" ") }.each do |_email, id|
|
2018-05-30 18:45:46 +02:00
|
|
|
|
User.find_by(id: id, current_sign_in_at: nil)&.destroy # ensure account was never used
|
2018-02-28 16:59:50 +01:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|