Rename @budget to @current budget at budget index

Clear instance variable names help understand what's going around when
you're deep 2 or 3 partials. In this case @budget is only used to carry
around the current_budget so @current_budget is more descriptive.

Using `current_budget` directly around would be an alternative, but
maybe not as maintainable in case we want to change which budget is
being shown (for example the drafting one if you're admin).
This commit is contained in:
Bertocq
2018-01-23 23:55:37 +01:00
parent e62ca48a94
commit 791f081a91
3 changed files with 17 additions and 17 deletions

View File

@@ -15,7 +15,7 @@ class BudgetsController < ApplicationController
def index
@finished_budgets = @budgets.finished.order(created_at: :desc)
@budget = current_budget
@current_budget = current_budget
@budgets_coordinates = current_budget_map_locations
end