mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-01-31 08:39:08 +01:00
answer is now returned in Inbox#answer
This commit is contained in:
parent
e2cabbe934
commit
5aab94207a
1 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue