mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-02-12 12:23:36 +01:00
Prevent errors in User#answer
when asking anonymous questions
This commit is contained in:
parent
14e84fd47c
commit
b657894576
1 changed files with 1 additions and 1 deletions
|
@ -107,7 +107,7 @@ class User < ApplicationRecord
|
||||||
# @param content [String] the answer content
|
# @param content [String] the answer content
|
||||||
def answer(question, content)
|
def answer(question, content)
|
||||||
# rubocop:disable Style/RedundantSelf
|
# rubocop:disable Style/RedundantSelf
|
||||||
raise Errors::AnsweringOtherBlockedSelf if question.user.blocking?(self)
|
raise Errors::AnsweringOtherBlockedSelf if question.user&.blocking?(self)
|
||||||
raise Errors::AnsweringSelfBlockedOther if self.blocking?(question.user)
|
raise Errors::AnsweringSelfBlockedOther if self.blocking?(question.user)
|
||||||
# rubocop:enable Style/RedundantSelf
|
# rubocop:enable Style/RedundantSelf
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue