|
|
|
@ -15,10 +15,13 @@ namespace :update_homework do
|
|
|
|
|
unless student_works.nil?
|
|
|
|
|
student_works.each do |s|
|
|
|
|
|
project = Project.find s.project_id
|
|
|
|
|
unless project.nil? && project.gpid.nil?
|
|
|
|
|
unless 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
|
|
|
|
|
if time.strftime('%Y-%m-%d %H:%M:%S') < project_time.strftime('%Y-%m-%d %H:%M:%S')
|
|
|
|
|
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
|
|
|
|
|
end
|
|
|
|
|
begin
|
|
|
|
@ -28,7 +31,10 @@ namespace :update_homework do
|
|
|
|
|
changesets = g.commits(project.gpid, :ref_name => default_branch)
|
|
|
|
|
changesets_latest_coimmit = changesets[0]
|
|
|
|
|
unless changesets[0].blank?
|
|
|
|
|
if time.strftime('%Y-%m-%d %H:%M:%S') <changesets_latest_coimmit.created_at.strftime('%Y-%m-%d %H:%M:%S')
|
|
|
|
|
puts "the time is =========================> #{time}"
|
|
|
|
|
puts "the changesets_latest_coimmit is =========================> #{changesets_latest_coimmit.created_at}"
|
|
|
|
|
#if time.strftime('%Y-%m-%d %H:%M:%S') < changesets_latest_coimmit.created_at.strftime('%Y-%m-%d %H:%M:%S')
|
|
|
|
|
if format_time(time) < format_time(changesets_latest_coimmit.created_at)
|
|
|
|
|
time = changesets_latest_coimmit.created_at
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|