From a153c7f3f7784e2a448576891e76a17b2f0bc47b Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 18 Nov 2019 14:50:29 +0800 Subject: [PATCH] fixbug --- lib/tasks/shixun_rep.rake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/tasks/shixun_rep.rake b/lib/tasks/shixun_rep.rake index cdae36c35..27ba7edf5 100644 --- a/lib/tasks/shixun_rep.rake +++ b/lib/tasks/shixun_rep.rake @@ -9,12 +9,13 @@ namespace :shixun_sync do subject_id = ENV['args'].to_s # 课程id puts subject_id - subject = Subject.find_by(subject_id) + subject = Subject.find_by(id: subject_id) subject.shixuns.try(:each) do |shixun| username = shixun.owner.try(:login) # new_repo_name = "#{username.try(:strip)}/#{shixun.try(:identifier)}#{ Time.now.strftime("%Y%m%d%H%M%S")}" # GitService.fork_repository(repo_path: "#{shixun.try(:repo_name)}.git", fork_repository_path: (new_repo_name + ".git")) - puts "#############{username}" + + puts "#############{shixun.id}" project_fork(shixun, "#{shixun.try(:repo_name)}.git", username) end end