Associate code harbor links with current user always
- this applies to creations and updates - code harbor links are only every edited in the context of the authenticated user (leoselig/codeocean#1)
This commit is contained in:
@ -35,6 +35,7 @@ class CodeHarborLinksController < ApplicationController
|
|||||||
# POST /code_harbor_links.json
|
# POST /code_harbor_links.json
|
||||||
def create
|
def create
|
||||||
@code_harbor_link = CodeHarborLink.new(code_harbor_link_params)
|
@code_harbor_link = CodeHarborLink.new(code_harbor_link_params)
|
||||||
|
@code_harbor_link.user = current_user
|
||||||
authorize!
|
authorize!
|
||||||
create_and_respond(object: @code_harbor_link)
|
create_and_respond(object: @code_harbor_link)
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user