Merge branch 'dev' into frederic/fix_1865_api_expose_pj_champ

This commit is contained in:
Paul Chavard 2018-04-25 15:30:44 +02:00 committed by GitHub
commit a5835a9777
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

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

View file

@ -35,8 +35,8 @@ module Flipflop::Strategies
end
def find_current_administrateur
if request.session["warden.user.user.key"]
administrateur_id = request.session["warden.user.user.key"][0][0]
if request.session["warden.user.administrateur.key"]
administrateur_id = request.session["warden.user.administrateur.key"][0][0]
Administrateur.find_by(id: administrateur_id)
end
end