Merge pull request #1870 from betagouv/fix_1868_bad_filter

[#1868] ProcedureController: rescue date parsing
This commit is contained in:
LeSim 2018-04-25 12:09:56 +02:00 committed by GitHub
commit cd7a73075c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -237,9 +237,10 @@ module NewGestionnaire
when 'user', 'etablissement', 'entreprise' when 'user', 'etablissement', 'entreprise'
if filter['column'] == 'date_creation' if filter['column'] == 'date_creation'
date = filter['value'].to_date rescue nil
dossiers dossiers
.includes(filter['table']) .includes(filter['table'])
.where("#{filter['table'].pluralize}.#{filter['column']} = ?", filter['value'].to_date) .where("#{filter['table'].pluralize}.#{filter['column']} = ?", date)
else else
dossiers dossiers
.includes(filter['table']) .includes(filter['table'])