app/controllers/phcscriptcdn/script/licences_controller.rb in phcscriptcdn-49.0.0 vs app/controllers/phcscriptcdn/script/licences_controller.rb in phcscriptcdn-50.0.0
- old
+ new
@@ -9,11 +9,11 @@
before_action :set_paper_trail_whodunnit
before_action :set_script_licence, only: [:show, :edit, :update, :destroy]
# INDEX - Script Licences
def index
- @script_licences = Script::Licence.where(org_id: current_user.org_id)
+ @script_licences = Script::Licence.all
end
# DETAILS - Script Licences
def show
@script_licences = Script::Licence.friendly.find(params[:id])
@@ -21,34 +21,29 @@
end
# NEW - Script Licences
def new
@script_licence = Script::Licence.new
- @script_licence.user_id = current_user.id
- @script_licence.org_id = current_user.org_id
end
# EDIT - Script Licences
def edit
end
# POST - Script Licences
def create
@script_licence = Script::Licence.new(script_licence_params)
@script_licence.user_id = current_user.id
- @script_licence.org_id = current_user.org_id
if @script_licence.save
redirect_to script_licences_url, notice: 'Licence was successfully created.'
else
render :new
end
end
# PATCH/PUT - Script Licences
def update
- @script_licence.user_id = current_user.id
- @script_licence.org_id = current_user.org_id
if @script_licence.update(script_licence_params)
redirect_to script_licences_url, notice: 'Licence was successfully updated.'
else
render :edit
end
@@ -67,10 +62,10 @@
@script_licence = Script::Licence.friendly.find(params[:id])
end
# Whitelists
def script_licence_params
- params.require(:script_licence).permit(:lcncname, :lcncdescription, :lcncdescript, :lcnccomgpl, :lcncarvlfsf, :lcncarvlosi, :lcncarvlcopyfree, :lcncarvldebian, :lcncarvlfedora, :slug, :user_id, :org_id, :listing_id)
+ params.require(:script_licence).permit(:licence_name, :licence_description, :licence_compatible_gpl, :licence_approval_fsf, :licence_approval_osi, :licence_approval_copyfree, :licence_approval_debian, :licence_approval_fedora, :slug, :user_id, :org_id, :listing_id)
end
end
end