Use find instead of find_by_id
Better raise a 404 HTML NotFound exception than any other unexpected error.
This commit is contained in:
committed by
Javi Martín
parent
22076dd95c
commit
b122302c58
@@ -62,7 +62,7 @@ class Management::Budgets::InvestmentsController < Management::BaseController
|
||||
end
|
||||
|
||||
def load_budget
|
||||
@budget = Budget.find_by(slug: params[:budget_id]) || Budget.find_by(id: params[:budget_id])
|
||||
@budget = Budget.find_by_slug_or_id! params[:budget_id]
|
||||
end
|
||||
|
||||
def load_categories
|
||||
|
||||
Reference in New Issue
Block a user