Skip to content

Commit

Permalink
Adjust default budget filter
Browse files Browse the repository at this point in the history
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
  • Loading branch information
microweb10 authored and javierm committed Mar 15, 2021
1 parent 6bd20ef commit 5d38e47
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/concerns/investment_filters.rb
Expand Up @@ -8,10 +8,10 @@ def investment_filters
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

0 comments on commit 5d38e47

Please sign in to comment.