diff --git a/app/models/user.rb b/app/models/user.rb index 762f7020..1f157482 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -117,10 +117,8 @@ class User < ApplicationRecord # @param question [Question] the question to answer # @param content [String] the answer content def answer(question, content) - # rubocop:disable Style/RedundantSelf raise Errors::AnsweringOtherBlockedSelf if question.user&.blocking?(self) raise Errors::AnsweringSelfBlockedOther if self.blocking?(question.user) - # rubocop:enable Style/RedundantSelf Retrospring::Metrics::QUESTIONS_ANSWERED.increment @@ -132,10 +130,8 @@ class User < ApplicationRecord def answered?(question) = question.answers.pluck(:user_id).include? id def comment(answer, content) - # rubocop:disable Style/RedundantSelf raise Errors::CommentingSelfBlockedOther if self.blocking?(answer.user) raise Errors::CommentingOtherBlockedSelf if answer.user.blocking?(self) - # rubocop:enable Style/RedundantSelf Retrospring::Metrics::COMMENTS_CREATED.increment diff --git a/app/models/user/reaction_methods.rb b/app/models/user/reaction_methods.rb index 18ecac25..fa3e6545 100644 --- a/app/models/user/reaction_methods.rb +++ b/app/models/user/reaction_methods.rb @@ -4,10 +4,8 @@ module User::ReactionMethods # smiles an answer or comment # @param item [ApplicationRecord] the answer/comment to smile def smile(item) - # rubocop:disable Style/RedundantSelf raise Errors::ReactingSelfBlockedOther if self.blocking?(item.user) raise Errors::ReactingOtherBlockedSelf if item.user.blocking?(self) - # rubocop:enable Style/RedundantSelf ::Appendable::Reaction.create!(user: self, parent: item, content: "🙂") end diff --git a/app/models/user/relationship/follow.rb b/app/models/user/relationship/follow.rb index 4e034821..50dc321e 100644 --- a/app/models/user/relationship/follow.rb +++ b/app/models/user/relationship/follow.rb @@ -19,10 +19,8 @@ class User # Follow an user def follow(target_user) raise Errors::FollowingSelf if target_user == self - # rubocop:disable Style/RedundantSelf raise Errors::FollowingOtherBlockedSelf if target_user.blocking?(self) raise Errors::FollowingSelfBlockedOther if self.blocking?(target_user) - # rubocop:enable Style/RedundantSelf create_relationship(active_follow_relationships, target_user) end