diff --git a/app/models/inbox.rb b/app/models/inbox.rb index 458e9d63..81df46b7 100644 --- a/app/models/inbox.rb +++ b/app/models/inbox.rb @@ -7,6 +7,9 @@ class Inbox < ApplicationRecord end 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) self.destroy answer