Fix lint errors

This commit is contained in:
Karina Kwiatek 2022-01-24 22:46:11 +01:00 committed by Karina Kwiatek
parent 1216c249e8
commit 72906ca549
4 changed files with 14 additions and 14 deletions

View File

@ -12,10 +12,10 @@ class QuestionWorker
question = Question.find(question_id) question = Question.find(question_id)
user.followers.each do |f| user.followers.each do |f|
if MuteRule.where(user: f).none? { |rule| rule.applies_to? question } next if MuteRule.where(user: f).any? { |rule| rule.applies_to? question }
Inbox.create(user_id: f.id, question_id: question_id, new: true) Inbox.create(user_id: f.id, question_id: question_id, new: true)
end end
end
rescue StandardError => e rescue StandardError => e
logger.info "failed to ask question: #{e.message}" logger.info "failed to ask question: #{e.message}"
Sentry.capture_exception(e) Sentry.capture_exception(e)

View File

@ -48,11 +48,11 @@ module UseCase
end end
def check_blocks def check_blocks
if source_user_id.present? return if source_user_id.blank?
raise Errors::AskingOtherBlockedSelf if target_user.blocking?(source_user) raise Errors::AskingOtherBlockedSelf if target_user.blocking?(source_user)
raise Errors::AskingSelfBlockedOther if source_user.blocking?(target_user) raise Errors::AskingSelfBlockedOther if source_user.blocking?(target_user)
end end
end
def increment_asked_count def increment_asked_count
unless source_user_id && !anonymous unless source_user_id && !anonymous