消息报错

chromesetting
daiao 5 years ago
parent 09633ebf3e
commit 3dd6234a0a

@ -54,9 +54,14 @@ class Discuss < ApplicationRecord
def send_tiding
base_attrs = {
trigger_user_id: user_id, parent_container_id: challenge_id, parent_container_type: 'Challenge',
belong_container_id: dis_id, belong_container_type: 'Shixun', viewed: 0, tiding_type: 'Comment'
belong_container_id: dis_id, belong_container_type: dis_type, viewed: 0, tiding_type: 'Comment'
}
user_id = has_parent? ? parent.user_id : Challenge.find(challenge_id).user_id
user_id =
if dis_type == 'Shixun'
has_parent? ? parent.user_id : Challenge.find(challenge_id).user_id
elsif dis_type == 'Hack'
has_parent? ? parent.user_id : Hack.find(dis_id).user_id
end
tidings.create!(base_attrs.merge(user_id: user_id))
end
end

Loading…
Cancel
Save