rake 任务查询修改
This commit is contained in:
parent
91d7632ef1
commit
436d488d72
|
@ -28,7 +28,7 @@ namespace :gitlab do
|
|||
|
||||
task :useless_user => :environment do
|
||||
# projects = Project.where(:id => [6286, 6292, 6293, 6294])
|
||||
users = User.where("SELECT * FROM `users` where gid is not null group by gid having count(*)=2")
|
||||
users = User.find_by_sql("SELECT * FROM `users` where gid is not null group by gid having count(*)=2")
|
||||
# users = User.where(:gid => 8823)
|
||||
users.each do |user|
|
||||
puts "start"+ "#{user.id}"
|
||||
|
|
Loading…
Reference in New Issue