From 8942d9a094dfc181fb6888cd90b3d203caad276c Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 8 Apr 2013 11:23:03 -0400 Subject: [PATCH] Okay, THIS time the specs should pass. Geez. --- lib/post_creator.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/post_creator.rb b/lib/post_creator.rb index 18177162f2e..824be4e9856 100644 --- a/lib/post_creator.rb +++ b/lib/post_creator.rb @@ -132,9 +132,9 @@ class PostCreator # We need to enqueue jobs after the transaction. Otherwise they might begin before the data has # been comitted. - Jobs.enqueue(:feature_topic_users, topic_id: topic.id) if topic.present? - - post.trigger_post_process + topic_id = @opts[:topic_id] || topic.try(:id) + Jobs.enqueue(:feature_topic_users, topic_id: topic.id) if topic_id.present? + post.trigger_post_process if post.present? post end