[#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)
|
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
|
||||||
|
|
Loading…
Reference in a new issue