Add by_budget scope to Investment and use it

This commit is contained in:
Bertocq
2018-02-10 16:36:14 +01:00
parent bd10285431
commit 2341a2f70b
3 changed files with 4 additions and 3 deletions

View File

@@ -101,7 +101,7 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
end
def load_investment
@investment = Budget::Investment.where(budget_id: @budget.id).find(params[:id])
@investment = Budget::Investment.by_budget(@budget).find(params[:id])
end
def load_admins