Adjust default budget filter

Apart from 'balloting', there are more phases between
'publishing_prices' and 'finished'. So, it doesn't make sense that the
filter 'selected' is only applied to those two. With this change the
filter will be applied as follow:

'not_unfeasible' for phases:
- informing
- accepting
- reviewing
- selecting
- valuating

selected for phases:
- publishing_prices
- balloting
- reviewing_ballots

winners for phases:
- finished
This commit is contained in:
Julian Herrero
2020-04-30 10:38:15 +07:00
committed by Javi Martín
parent 6bd20ef5ff
commit 5d38e4702f

View File

@@ -8,10 +8,10 @@ module InvestmentFilters
end
def set_default_investment_filter
if @budget&.balloting? || @budget&.publishing_prices?
params[:filter] ||= "selected"
elsif @budget&.finished?
if @budget&.finished?
params[:filter] ||= "winners"
elsif @budget&.publishing_prices_or_later?
params[:filter] ||= "selected"
end
end
end