From 5aab94207aaea745eddc374ebc27a48e8f6511a7 Mon Sep 17 00:00:00 2001 From: nilsding Date: Fri, 12 Dec 2014 23:14:32 +0100 Subject: [PATCH] answer is now returned in Inbox#answer --- app/models/inbox.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/inbox.rb b/app/models/inbox.rb index 5cafaf83..5084084a 100644 --- a/app/models/inbox.rb +++ b/app/models/inbox.rb @@ -3,12 +3,13 @@ class Inbox < ActiveRecord::Base belongs_to :question def answer(answer, user) - Answer.create!(content: answer, - user: user, - question: self.question) + answer = Answer.create!(content: answer, + user: user, + question: self.question) user.increment! :answered_count self.question.increment! :answer_count self.destroy + answer end def remove