forked from External/greenlight
Social uid rake task (#2906)
This commit is contained in:
parent
beb414aec7
commit
e0972efc40
|
@ -57,4 +57,14 @@ namespace :user do
|
||||||
puts "PLEASE CHANGE YOUR PASSWORD IMMEDIATELY" if u[:password] == Rails.configuration.admin_password_default
|
puts "PLEASE CHANGE YOUR PASSWORD IMMEDIATELY" if u[:password] == Rails.configuration.admin_password_default
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
Loading…
Reference in New Issue