From 76c614ea66f2b4192527de2ca54c668eeae153c5 Mon Sep 17 00:00:00 2001 From: nilsding Date: Fri, 12 Dec 2014 23:45:49 +0100 Subject: [PATCH] alright --- app/controllers/ajax/inbox_controller.rb | 8 +++++++- app/workers/share_worker.rb | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 app/workers/share_worker.rb diff --git a/app/controllers/ajax/inbox_controller.rb b/app/controllers/ajax/inbox_controller.rb index 2f30106f..a8c33547 100644 --- a/app/controllers/ajax/inbox_controller.rb +++ b/app/controllers/ajax/inbox_controller.rb @@ -34,8 +34,10 @@ class Ajax::InboxController < ApplicationController return end + a = nil + begin - inbox.answer params[:answer], current_user + a = inbox.answer params[:answer], current_user rescue @status = :err @message = "An error occurred" @@ -43,6 +45,10 @@ class Ajax::InboxController < ApplicationController return end + current_user.services.each do |service| + service.post a + end + @status = :okay @message = "Successfully answered question." @success = true diff --git a/app/workers/share_worker.rb b/app/workers/share_worker.rb new file mode 100644 index 00000000..079baaee --- /dev/null +++ b/app/workers/share_worker.rb @@ -0,0 +1,9 @@ +class ShareWorker + include Sidekiq::Worker + + sidekiq_options queue: :share + + def perform(answer_id) + # fuck this… for now + end +end \ No newline at end of file