Extract concern to handle investments filters

We were defining the same filters in three different controllers. We
were also adding a method in the ApplicationController which only made
sense in the same three controllers.
This commit is contained in:
Javi Martín
2021-03-14 20:56:42 +01:00
parent 313c9eaeba
commit 6bd20ef5ff
5 changed files with 27 additions and 15 deletions

View File

@@ -111,14 +111,6 @@ class ApplicationController < ActionController::Base
end
end
def set_default_budget_filter
if @budget&.balloting? || @budget&.publishing_prices?
params[:filter] ||= "selected"
elsif @budget&.finished?
params[:filter] ||= "winners"
end
end
def current_budget
Budget.current
end