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
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue