Find group inside budget
We were having a problem were some groups where not updating correctly. That was because it was finding the first group with that name. However we were looking for another group with the same name from another budget Apart from the group_id, we also get the budget_id in the params for updating a group. By finding groups within that budget we get the expected behaviour
This commit is contained in:
@@ -9,7 +9,7 @@ class Admin::BudgetGroupsController < Admin::BaseController
|
||||
end
|
||||
|
||||
def update
|
||||
@group = Budget::Group.by_slug(params[:id]).first
|
||||
@group = @budget.groups.by_slug(params[:id]).first
|
||||
@group.update(budget_group_params)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user