rake 任务的一些修改
This commit is contained in:
parent
436d488d72
commit
c0f1e355ec
|
@ -28,7 +28,9 @@ namespace :gitlab do
|
|||
|
||||
task :useless_user => :environment do
|
||||
# projects = Project.where(:id => [6286, 6292, 6293, 6294])
|
||||
users = User.find_by_sql("SELECT * FROM `users` where gid is not null group by gid having count(*)=2")
|
||||
ids = User.find_by_sql("select gid from users where gid is not null group by gid having count(gid) > 1").map(&:gid)
|
||||
users = User.where(:gid => ids)
|
||||
g = Gitlab.client
|
||||
# users = User.where(:gid => 8823)
|
||||
users.each do |user|
|
||||
puts "start"+ "#{user.id}"
|
||||
|
|
Loading…
Reference in New Issue