This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/lib/tasks/member_user_id.rake

34 lines
407 B
Ruby

# encoding: utf-8
namespace :member_user_id do
task :member_user_id_copy => :environment do
puts 'start'
@users = User.all
@users.each do |user|
if user.user_id.blank?
@ids = []
@ids = user.email.split("@")
user.user_id = @ids[0]
user.save
else
puts 'no data'
end
end
puts 'end'
puts @users.count
end
end