[#3477] Simplify removing a filter
This commit is contained in:
parent
822a3f7098
commit
ac4750e5e3
1 changed files with 2 additions and 4 deletions
|
@ -158,11 +158,9 @@ module NewGestionnaire
|
|||
|
||||
def remove_filter
|
||||
filters = procedure_presentation.filters
|
||||
filter_to_remove = current_filters.find do |filter|
|
||||
filter['table'] == params[:table] && filter['column'] == params[:column]
|
||||
end
|
||||
|
||||
filters[statut] = filters[statut] - [filter_to_remove]
|
||||
to_remove = params.values_at(:table, :column)
|
||||
filters[statut].reject! { |filter| filter.values_at('table', 'column') == to_remove }
|
||||
|
||||
procedure_presentation.update(filters: filters)
|
||||
|
||||
|
|
Loading…
Reference in a new issue