Fix lint errors
This commit is contained in:
parent
1216c249e8
commit
72906ca549
|
@ -43,18 +43,18 @@ class Ajax::QuestionController < AjaxController
|
|||
|
||||
if user_signed_in? && params[:rcpt] == "followers"
|
||||
UseCase::Question::CreateFollowers.call(
|
||||
source_user_id: current_user.id,
|
||||
content: params[:question],
|
||||
source_user_id: current_user.id,
|
||||
content: params[:question],
|
||||
author_identifier: AnonymousBlock.get_identifier(request.ip)
|
||||
)
|
||||
return
|
||||
end
|
||||
|
||||
UseCase::Question::Create.call(
|
||||
source_user_id: user_signed_in? ? current_user.id : nil,
|
||||
target_user_id: params[:rcpt],
|
||||
content: params[:question],
|
||||
anonymous: params[:anonymousQuestion],
|
||||
source_user_id: user_signed_in? ? current_user.id : nil,
|
||||
target_user_id: params[:rcpt],
|
||||
content: params[:question],
|
||||
anonymous: params[:anonymousQuestion],
|
||||
author_identifier: AnonymousBlock.get_identifier(request.ip)
|
||||
)
|
||||
end
|
||||
|
|
|
@ -26,7 +26,7 @@ class AjaxController < ApplicationController
|
|||
@response = {
|
||||
success: false,
|
||||
message: e.message,
|
||||
status: e.code
|
||||
status: e.code
|
||||
}
|
||||
|
||||
return_response
|
||||
|
|
|
@ -12,9 +12,9 @@ class QuestionWorker
|
|||
question = Question.find(question_id)
|
||||
|
||||
user.followers.each do |f|
|
||||
if MuteRule.where(user: f).none? { |rule| rule.applies_to? question }
|
||||
Inbox.create(user_id: f.id, question_id: question_id, new: true)
|
||||
end
|
||||
next if MuteRule.where(user: f).any? { |rule| rule.applies_to? question }
|
||||
|
||||
Inbox.create(user_id: f.id, question_id: question_id, new: true)
|
||||
end
|
||||
rescue StandardError => e
|
||||
logger.info "failed to ask question: #{e.message}"
|
||||
|
|
|
@ -48,10 +48,10 @@ module UseCase
|
|||
end
|
||||
|
||||
def check_blocks
|
||||
if source_user_id.present?
|
||||
raise Errors::AskingOtherBlockedSelf if target_user.blocking?(source_user)
|
||||
raise Errors::AskingSelfBlockedOther if source_user.blocking?(target_user)
|
||||
end
|
||||
return if source_user_id.blank?
|
||||
|
||||
raise Errors::AskingOtherBlockedSelf if target_user.blocking?(source_user)
|
||||
raise Errors::AskingSelfBlockedOther if source_user.blocking?(target_user)
|
||||
end
|
||||
|
||||
def increment_asked_count
|
||||
|
|
Loading…
Reference in New Issue