From 88c57e0b0ccbf0a8992d0b801832bebc6c7edb0b Mon Sep 17 00:00:00 2001 From: iCross Date: Sat, 25 May 2013 10:05:19 +0800 Subject: [PATCH] fix --- vendor/built_in_modules/survey/app/models/survey.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vendor/built_in_modules/survey/app/models/survey.rb b/vendor/built_in_modules/survey/app/models/survey.rb index 51abfd36b..57fa3998e 100644 --- a/vendor/built_in_modules/survey/app/models/survey.rb +++ b/vendor/built_in_modules/survey/app/models/survey.rb @@ -43,12 +43,12 @@ class Survey def time_range r = "#{self.postdate.to_date}" - r += "- #{self.deadline.to_date}" unless self.deadline.nil? + r += "- #{self.deadline.to_date}" if self.deadline r end def result - if ( self.result_type == Survey::ResultChart && Time.now > self.deadline ) || + if ( self.result_type == Survey::ResultChart && self.deadline && Time.now > self.deadline ) || ( self.result_type == Survey::ResultExtern && !self.extern_link.blank? ) || ( self.result_type == Survey::ResultFile && self.upload_file? ) ('').html_safe @@ -58,7 +58,7 @@ class Survey end def write - if Time.now < self.deadline + if self.deadline || Time.now < self.deadline ('').html_safe else ''