From 87e1e0c4b106e6eb06477f4f88aad1f74d940764 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 15 Jul 2016 14:45:06 +0800 Subject: [PATCH] =?UTF-8?q?rake=E4=BB=BB=E5=8A=A1=EF=BC=8C=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E4=BD=9C=E4=B8=9A=E5=85=B3=E8=81=94=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=90=8E=E8=8E=B7=E5=8F=96=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BA=93=E6=8F=90=E4=BA=A4=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/update_homework.rake | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/tasks/update_homework.rake b/lib/tasks/update_homework.rake index d97004c8c..33bcc2231 100644 --- a/lib/tasks/update_homework.rake +++ b/lib/tasks/update_homework.rake @@ -15,11 +15,9 @@ namespace :update_homework do unless student_works.nil? student_works.each do |s| project = Project.find s.project_id - unless project.nil? && project.gpid.blank? + if !project.nil? && !project.gpid.blank? project_time=project.updated_on project_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last - puts "the time is =========================> #{time}" - puts "the project_time is =========================> #{project_time}" if time.strftime('%Y-%m-%d %H:%M:%S') < project_time.strftime('%Y-%m-%d %H:%M:%S') #if format_time(time) < format_time(project_time) time = project_time @@ -31,9 +29,6 @@ namespace :update_homework do changesets = g.commits(project.gpid, :ref_name => default_branch) changesets_latest_coimmit = changesets[0] unless changesets[0].blank? - puts "the time is =========================> #{time}" - puts "the changesets_latest_coimmit is =========================> #{changesets_latest_coimmit.created_at}" - puts "the distance time is =========================> #{changesets_latest_coimmit.created_at.to_time > Time.now}" if time.strftime('%Y-%m-%d %H:%M:%S') < changesets_latest_coimmit.created_at.to_time.strftime('%Y-%m-%d %H:%M:%S') #if format_time(time) < format_time(changesets_latest_coimmit.created_at) time = changesets_latest_coimmit.created_at.to_time