Add and apply ShadowingOuterLocalVariable rule

Naming two variables the same way is confusing at the very least, and
can lead to hard to debug errors. That's why the Ruby interpreter issues
a warning when we do so.
This commit is contained in:
Javi Martín
2019-09-28 21:09:56 +02:00
parent 70a07c095f
commit d6eb9f8fb6
4 changed files with 15 additions and 13 deletions

View File

@@ -58,14 +58,13 @@ class Tracking::BudgetInvestmentsController < Tracking::BaseController
}
]
filters = investment_headings.inject(all_headings_filter) do |filters, heading|
investment_headings.inject(all_headings_filter) do |filters, heading|
filters << {
name: heading.name,
id: heading.id,
count: investments.select { |i| i.heading_id == heading.id }.size
}
end
filters.uniq
end.uniq
end
def restrict_access_to_assigned_items