From e51574bea0a9e5d3a5e7238713558f21dd3f12d6 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 2 Dec 2016 17:17:03 +0800 Subject: [PATCH] FIX: No need to fetch the model. --- app/models/web_hook.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/web_hook.rb b/app/models/web_hook.rb index 289938329e6..9884bbf52eb 100644 --- a/app/models/web_hook.rb +++ b/app/models/web_hook.rb @@ -41,11 +41,11 @@ class WebHook < ActiveRecord::Base end def self.enqueue_topic_hooks(event, topic, user=nil) - WebHook.enqueue_hooks(:topic, topic_id: topic.id, user_id: user&.id, category_id: topic&.category&.id, event_name: event.to_s) + WebHook.enqueue_hooks(:topic, topic_id: topic.id, user_id: user&.id, category_id: topic&.category_id, event_name: event.to_s) end def self.enqueue_post_hooks(event, post, user=nil) - WebHook.enqueue_hooks(:post, post_id: post.id, topic_id: post&.topic&.id, user_id: user&.id, category_id: post&.topic&.category_id, event_name: event.to_s) + WebHook.enqueue_hooks(:post, post_id: post.id, topic_id: post&.topic_id, user_id: user&.id, category_id: post&.topic&.category_id, event_name: event.to_s) end %i(topic_destroyed topic_recovered).each do |event|