You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/lib/tasks/check_reponame.rake

16 lines
524 B

namespace :myshixun do
task check_reponame: :environment do
# 如果是选择题的则跳过否则reponame 为空的则为异常
myshixuns = Myshixun.where("repo_name is null and created_at > '2019-07-20 00:00:00'")
myshixuns.each do |myshixun|
shixun = myshixun.shixun
challenges = shixun.challenges
# 不是纯选择题的情况
if challenges.count != challenges.select{|challenge| challenge.st == 0}
puts myshixun.games.first.try(:identifier)
end
end
end
end