From 0a7a4eae99a76b988f63f708f694e936dd4e0e91 Mon Sep 17 00:00:00 2001 From: riking Date: Tue, 26 Aug 2014 17:58:43 -0700 Subject: [PATCH] Publish lightboxing on the message bus With this change, images appear to lightbox instantly on my development machine. --- app/jobs/regular/process_post.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/jobs/regular/process_post.rb b/app/jobs/regular/process_post.rb index e8753e7e16..49d9684a09 100644 --- a/app/jobs/regular/process_post.rb +++ b/app/jobs/regular/process_post.rb @@ -16,7 +16,16 @@ module Jobs cp.post_process(args[:bypass_bump]) # If we changed the document, save it - post.update_column(:cooked, cp.html) if cp.dirty? + if cp.dirty? + post.update_column(:cooked, cp.html) + + MessageBus.publish("/topic/#{post.topic_id}", { + type: "revised", + id: post.id, + updated_at: Time.now, + post_number: post.post_number + }, group_ids: post.topic.secure_group_ids ) + end end end