[#3477] Reuse existing filtering facility
This commit is contained in:
parent
efa71284fc
commit
c53370e14c
1 changed files with 2 additions and 5 deletions
|
@ -168,11 +168,8 @@ class ProcedurePresentation < ApplicationRecord
|
|||
dossiers = dossiers.includes(:champs_private).references(:champs_private)
|
||||
end
|
||||
|
||||
where_conditions = fields.map do |field|
|
||||
"champs.type_de_champ_id = #{field['column']}"
|
||||
end.join(" OR ")
|
||||
|
||||
dossiers.where(where_conditions)
|
||||
Filter.new(dossiers)
|
||||
.where_equals('champs.type_de_champ_id', fields.pluck('column'))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue