动态的更新时间

dev_pull v20160712_01
cxt 9 years ago
parent 89819f5ccd
commit 66c40ba139

@ -20,8 +20,8 @@ namespace :update_homework do
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)
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
@ -33,9 +33,10 @@ namespace :update_homework do
unless changesets[0].blank?
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
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
end
end
rescue Exception => e

Loading…
Cancel
Save