From 82568b59514fadce49bb50b6bc74751fa1a29e86 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 20 May 2016 11:39:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=BA=E9=99=B7=E7=8A=B6=E6=80=81=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E6=88=96=E5=86=85=E5=AE=B9=E6=9B=B4=E6=94=B9=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E5=8F=91=E6=A8=A1=E6=9D=BF=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/journal.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models/journal.rb b/app/models/journal.rb index 02086fa62..eeaa17dd6 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -239,8 +239,10 @@ class Journal < ActiveRecord::Base #缺陷回复微信模板消息 def issue_wechat_message - ws = WechatService.new - content = strip_html self.notes.html_safe, 200 - ws.comment_template self.issue.author_id, "issues", self.journalized_id, "#{l(:label_issue_comment_template)}", self.user.try(:realname), format_time(self.created_on), content + if !self.notes.nil? && self.notes.gsub(' ','') != '' + ws = WechatService.new + content = strip_html self.notes.html_safe, 200 + ws.comment_template self.issue.author_id, "issues", self.journalized_id, "#{l(:label_issue_comment_template)}", self.user.try(:realname), format_time(self.created_on), content + end end end