app/controllers/phcscriptcdn/script/urls_controller.rb in phcscriptcdn-49.0.0 vs app/controllers/phcscriptcdn/script/urls_controller.rb in phcscriptcdn-50.0.0
- old
+ new
@@ -23,12 +23,10 @@
# NEW - Script Athors
def new
script_listing = Script::Listing.find(params[:listing_id])
@script_url = script_listing.urls.build
- @script_url.user_id = current_user.id
- @script_url.org_id = current_user.org_id
end
# EDIT - Script Athors
def edit
script_listing = Script::Listing.find(params[:listing_id])
@@ -38,22 +36,19 @@
# POST - Script Athors
def create
@script_listing = Script::Listing.find(params[:listing_id])
@script_url = @script_listing.urls.create(script_url_params)
@script_url.user_id = current_user.id
- @script_url.org_id = current_user.org_id
if @script_url.save
redirect_to script_listing_urls_path, notice: 'Author was successfully created.'
else
render :new
end
end
# PATCH/PUT - Script Athors
def update
- @script_url.user_id = current_user.id
- @script_url.org_id = current_user.org_id
if @script_url.update(script_url_params)
redirect_to script_listing_urls_path, notice: 'Author was successfully updated.'
else
render :edit
end
@@ -74,10 +69,10 @@
@script_url = Script::Url.friendly.find(params[:id])
end
# Whitelists
def script_url_params
- params.require(:script_url).permit(:scripturl, :scripturlrelease, :scripturlcdnupdate, :slug, :user_id, :org_id, :listing_id, :version_id, :extension_id)
+ params.require(:script_url).permit(:script_url, :script_url_release, :script_url_cdn_update, :slug, :user_id, :listing_id, :version_id, :extension_id)
end
end
end