Show unfeasible and unselected investments for finished budgets

We were filtering by winners investments for finished budget without
having in consideration other filters.
We want the default filter to be `winners` for finished budgets.
This commit is contained in:
Julian Herrero
2019-01-29 20:28:57 +01:00
parent c6f2aacb51
commit c9522b424b
5 changed files with 69 additions and 27 deletions

View File

@@ -120,6 +120,8 @@ class ApplicationController < ActionController::Base
def set_default_budget_filter
if @budget.try(:balloting?) || @budget.try(:publishing_prices?)
params[:filter] ||= "selected"
elsif @budget.try(:finished?)
params[:filter] ||= "winners"
end
end