Remove superfluous rubocop:disable comments
This commit is contained in:
parent
9658f10838
commit
ffcaa5c4d9
|
@ -117,10 +117,8 @@ class User < ApplicationRecord
|
||||||
# @param question [Question] the question to answer
|
# @param question [Question] the question to answer
|
||||||
# @param content [String] the answer content
|
# @param content [String] the answer content
|
||||||
def answer(question, content)
|
def answer(question, content)
|
||||||
# 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
|
|
||||||
|
|
||||||
Retrospring::Metrics::QUESTIONS_ANSWERED.increment
|
Retrospring::Metrics::QUESTIONS_ANSWERED.increment
|
||||||
|
|
||||||
|
@ -132,10 +130,8 @@ class User < ApplicationRecord
|
||||||
def answered?(question) = question.answers.pluck(:user_id).include? id
|
def answered?(question) = question.answers.pluck(:user_id).include? id
|
||||||
|
|
||||||
def comment(answer, content)
|
def comment(answer, content)
|
||||||
# rubocop:disable Style/RedundantSelf
|
|
||||||
raise Errors::CommentingSelfBlockedOther if self.blocking?(answer.user)
|
raise Errors::CommentingSelfBlockedOther if self.blocking?(answer.user)
|
||||||
raise Errors::CommentingOtherBlockedSelf if answer.user.blocking?(self)
|
raise Errors::CommentingOtherBlockedSelf if answer.user.blocking?(self)
|
||||||
# rubocop:enable Style/RedundantSelf
|
|
||||||
|
|
||||||
Retrospring::Metrics::COMMENTS_CREATED.increment
|
Retrospring::Metrics::COMMENTS_CREATED.increment
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,8 @@ module User::ReactionMethods
|
||||||
# smiles an answer or comment
|
# smiles an answer or comment
|
||||||
# @param item [ApplicationRecord] the answer/comment to smile
|
# @param item [ApplicationRecord] the answer/comment to smile
|
||||||
def smile(item)
|
def smile(item)
|
||||||
# rubocop:disable Style/RedundantSelf
|
|
||||||
raise Errors::ReactingSelfBlockedOther if self.blocking?(item.user)
|
raise Errors::ReactingSelfBlockedOther if self.blocking?(item.user)
|
||||||
raise Errors::ReactingOtherBlockedSelf if item.user.blocking?(self)
|
raise Errors::ReactingOtherBlockedSelf if item.user.blocking?(self)
|
||||||
# rubocop:enable Style/RedundantSelf
|
|
||||||
|
|
||||||
::Appendable::Reaction.create!(user: self, parent: item, content: "🙂")
|
::Appendable::Reaction.create!(user: self, parent: item, content: "🙂")
|
||||||
end
|
end
|
||||||
|
|
|
@ -19,10 +19,8 @@ class User
|
||||||
# Follow an user
|
# Follow an user
|
||||||
def follow(target_user)
|
def follow(target_user)
|
||||||
raise Errors::FollowingSelf if target_user == self
|
raise Errors::FollowingSelf if target_user == self
|
||||||
# rubocop:disable Style/RedundantSelf
|
|
||||||
raise Errors::FollowingOtherBlockedSelf if target_user.blocking?(self)
|
raise Errors::FollowingOtherBlockedSelf if target_user.blocking?(self)
|
||||||
raise Errors::FollowingSelfBlockedOther if self.blocking?(target_user)
|
raise Errors::FollowingSelfBlockedOther if self.blocking?(target_user)
|
||||||
# rubocop:enable Style/RedundantSelf
|
|
||||||
|
|
||||||
create_relationship(active_follow_relationships, target_user)
|
create_relationship(active_follow_relationships, target_user)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue