Skip to content

Commit ab41fc4

Browse files
committed
Use Identifiable#current_user in Api::ProjectsController#update
Previously this was using the `@current_user` instance variable. However, I think this was working somewhat by accident - probably because `authorize_resource` was calling `Identifiable#current_user` and thus setting `@current_user`. I think it's safer to have an explicit call to `Identifiable#current_user`.
1 parent 50ec8bf commit ab41fc4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/api/projects_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def create
3939
end
4040

4141
def update
42-
result = Project::Update.call(project: @project, update_hash: project_params, current_user: @current_user)
42+
result = Project::Update.call(project: @project, update_hash: project_params, current_user:)
4343

4444
if result.success?
4545
render :show, formats: [:json]

0 commit comments

Comments
 (0)