DossierController: avoid unecessary user fetch

This commit is contained in:
simon lehericey 2018-03-04 14:31:31 +01:00
parent 360e368be3
commit 8ac5415ce0

View file

@ -99,7 +99,7 @@ module NewUser
end
def ensure_ownership!
if dossier.user != current_user
if dossier.user_id != current_user.id
flash[:alert] = "Vous n'avez pas accès à ce dossier"
redirect_to root_path
end