Apply Style/CollectionMethods rubocop rule
We were already using `map` and `reduce` almost everywhere.
This commit is contained in:
@@ -15,7 +15,7 @@ module Dashboard::GroupSupports
|
||||
|
||||
def accumulate_supports(grouped_votes)
|
||||
grouped_votes.each do |group, votes|
|
||||
grouped_votes[group] = votes.inject(0) { |sum, vote| sum + vote.vote_weight }
|
||||
grouped_votes[group] = votes.reduce(0) { |sum, vote| sum + vote.vote_weight }
|
||||
end
|
||||
|
||||
accumulated = 0
|
||||
|
||||
Reference in New Issue
Block a user