From 239a1484ae2573abe56b06086333e9ee168ad35d Mon Sep 17 00:00:00 2001 From: yanxd Date: Thu, 7 Nov 2013 14:38:37 +0800 Subject: [PATCH] remove useless code block --- app/controllers/projects_controller.rb | 1 - app/helpers/courses_helper.rb | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index adc68c25..38e23c79 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -491,7 +491,6 @@ class ProjectsController < ApplicationController @trackers = Tracker.sorted.all @project = Project.new @project.safe_attributes = params[:project] - logger.error "=======================================================#{params[:project].class}" ##add by huang @course=Course.new @course.safe_attributes = params[:course] diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 0eb9cf3a..a1ec84ad 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -64,12 +64,11 @@ module CoursesHelper end def findCourseTime project - #logger.error "=============================#{l(:date)[:formats][:long] } " - date_format = l(:zh_date)[:formats][:default] - @course = Course.find_by_extra(@project.identifier) str = "" begin - unless @course.nil? + @course = Course.find_by_extra(@project.identifier) + date_format = l(:zh_date)[:formats][:default] + if @course str = DateTime.parse(@course.setup_time.to_s).strftime("#{date_format}").to_s unless @course.setup_time.blank? str << '-' unless @course.setup_time.blank? str << DateTime.parse(@course.endup_time.to_s).strftime("#{date_format}").to_s unless @course.endup_time.blank?