Fix Style/ParenthesesAroundCondition rubocop issues
This commit is contained in:
@@ -625,15 +625,6 @@ Style/ParallelAssignment:
|
||||
- 'lib/active_model/dates.rb'
|
||||
- 'spec/support/common_actions.rb'
|
||||
|
||||
# Offense count: 3
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: AllowSafeAssignment.
|
||||
Style/ParenthesesAroundCondition:
|
||||
Exclude:
|
||||
- 'app/controllers/proposals_controller.rb'
|
||||
- 'app/models/debate.rb'
|
||||
- 'app/models/proposal.rb'
|
||||
|
||||
# Offense count: 11
|
||||
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
|
||||
# NamePrefix: is_, has_, have_
|
||||
|
||||
@@ -88,7 +88,7 @@ class Debate < ActiveRecord::Base
|
||||
|
||||
def register_vote(user, vote_value)
|
||||
if votable_by?(user)
|
||||
Debate.increment_counter(:cached_anonymous_votes_total, id) if (user.unverified? && !user.voted_for?(self))
|
||||
Debate.increment_counter(:cached_anonymous_votes_total, id) if user.unverified? && !user.voted_for?(self)
|
||||
vote_by(voter: user, vote: vote_value)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -88,7 +88,7 @@ class Proposal < ActiveRecord::Base
|
||||
def self.search_by_code(terms)
|
||||
matched_code = match_code(terms)
|
||||
results = where(id: matched_code[1]) if matched_code
|
||||
return results if (results.present? && results.first.code == terms)
|
||||
return results if results.present? && results.first.code == terms
|
||||
end
|
||||
|
||||
def self.match_code(terms)
|
||||
|
||||
Reference in New Issue
Block a user