Disallow answering questions when blocked by its author
This commit is contained in:
parent
9f06b48569
commit
bd0a4532a5
|
@ -7,6 +7,9 @@ class Inbox < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def answer(answer_content, user)
|
def answer(answer_content, user)
|
||||||
|
raise Errors::AnsweringOtherBlockedSelf if question.user.blocking?(user)
|
||||||
|
raise Errors::AnsweringSelfBlockedOther if user.blocking?(question.user)
|
||||||
|
|
||||||
answer = user.answer(self.question, answer_content)
|
answer = user.answer(self.question, answer_content)
|
||||||
self.destroy
|
self.destroy
|
||||||
answer
|
answer
|
||||||
|
|
Loading…
Reference in New Issue