DossierController: avoid unecessary user fetch
This commit is contained in:
parent
360e368be3
commit
8ac5415ce0
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue