Skip to content
Snippets Groups Projects
Unverified Commit e0972efc authored by Ahmad Farhat's avatar Ahmad Farhat Committed by GitHub
Browse files

Social uid rake task (#2906)

parent beb414ae
No related branches found
No related tags found
No related merge requests found
......@@ -57,4 +57,14 @@ namespace :user do
puts "PLEASE CHANGE YOUR PASSWORD IMMEDIATELY" if u[:password] == Rails.configuration.admin_password_default
end
end
task :social_uid, [:provider] => :environment do |_task, args|
args.with_defaults(provider: "greenlight")
User.where(provider: args[:provider]).each do |user|
if user.update(social_uid: "#{args[:provider]}:#{user.email}")
puts "Updated #{user.email} to #{args[:provider]}:#{user.email}"
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment