Merge pull request #2723 from wairbut-m2c/backport_2400_combine_free_text_search_and_filters

Combine text search and filters for Investments on Admin panel
This commit is contained in:
Alberto
2018-07-25 14:42:19 +02:00
committed by GitHub
8 changed files with 247 additions and 120 deletions

View File

@@ -84,12 +84,8 @@ class Admin::BudgetInvestmentsController < Admin::BaseController
end
def load_investments
@investments = if params[:title_or_id].present?
Budget::Investment.search_by_title_or_id(params)
else
Budget::Investment.scoped_filter(params, @current_filter)
.order(sort_by(params[:sort_by]))
end
@investments = Budget::Investment.scoped_filter(params, @current_filter)
.order(sort_by(params[:sort_by]))
@investments = @investments.page(params[:page]) unless request.format.csv?
end