修复有时留言回复失败的BUG

This commit is contained in:
sw 2014-12-11 09:24:22 +08:00
parent 0442ccd365
commit e768abbf31
1 changed files with 3 additions and 2 deletions

View File

@ -255,7 +255,7 @@ class WordsController < ApplicationController
elsif referer.match(/course/)
obj = Course.find_by_id(obj_id)
else
raise "create reply obj unknow type.#{referer}"
#raise "create reply obj unknow type.#{referer}"
end
obj
end
@ -263,7 +263,8 @@ class WordsController < ApplicationController
def add_reply_adapter options
#modify by nwb
#添加对课程留言的支持
obj = obj_distinguish_url_origin
#留言回复应该不关系其所属的Class而关心的是其所属的父留言
obj = obj_distinguish_url_origin || User.find_by_id(2)
if obj.kind_of? User
obj.add_jour(nil, nil, nil, options)
elsif obj.kind_of? Project