Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use find instead of find by #3580

Merged
merged 5 commits into from
Jun 5, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use correct param in controller
There were some custom routes created using the param[:id] but the
Rails routes use the param[:budget_id] by default, so the same
controller could be asked for different param keys.
  • Loading branch information
microweb10 authored and javierm committed Jun 3, 2019
commit 4bd20eebf4f9e232ef1e55fc85ce1ffb9bcbb90b
4 changes: 3 additions & 1 deletion app/controllers/budgets/results_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ def show
private

def load_budget
@budget = Budget.find_by(id: params[:budget_id]) || Budget.first
@budget = Budget.find_by(slug: params[:budget_id])
@budget ||= Budget.find_by(id: params[:budget_id])
@budget ||= Budget.first
end

def load_heading
Expand Down