Move MessageBus observer into PostCreator

This commit is contained in:
Robin Ward
2013-03-18 14:45:05 -04:00
parent c24f6d3d51
commit aea848f164
4 changed files with 15 additions and 17 deletions

View File

@ -110,6 +110,13 @@ class PostCreator
# Update `last_posted_at` to match the post's created_at
@user.update_column(:last_posted_at, post.created_at)
# Publish the post in the message bus
MessageBus.publish("/topic/#{post.topic_id}",
id: post.id,
created_at: post.created_at,
user: BasicUserSerializer.new(post.user).as_json(root: false),
post_number: post.post_number)
end
post