[#3477] Reuse existing filtering facility

This commit is contained in:
Frederic Merizen 2019-02-19 17:03:29 +01:00
parent efa71284fc
commit c53370e14c

View file

@ -168,11 +168,8 @@ class ProcedurePresentation < ApplicationRecord
dossiers = dossiers.includes(:champs_private).references(:champs_private) dossiers = dossiers.includes(:champs_private).references(:champs_private)
end end
where_conditions = fields.map do |field| Filter.new(dossiers)
"champs.type_de_champ_id = #{field['column']}" .where_equals('champs.type_de_champ_id', fields.pluck('column'))
end.join(" OR ")
dossiers.where(where_conditions)
end end
end end
end end