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