app/controllers/phcscriptcdnpro/script/licences_controller.rb in phcscriptcdnpro-28.0.0 vs app/controllers/phcscriptcdnpro/script/licences_controller.rb in phcscriptcdnpro-29.0.0

- old
+ new

@@ -2,12 +2,11 @@ module Phcscriptcdnpro class Script::LicencesController < ApplicationController # Security & Action Filters - before_action :require_user - before_action :authrocket_membership_info + before_action :authenticate_user! before_action :set_paper_trail_whodunnit before_action :set_script_licence, only: [:show, :edit, :update, :destroy] # INDEX - Script Licences def index @@ -21,35 +20,33 @@ 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.user_name = current_user.username - @script_licence.membership_id = authrocket_membership_info.id - @script_licence.oganization_id = authrocket_membership_info.org_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.user_name = current_user.username - @script_licence.membership_id = authrocket_membership_info.id - @script_licence.oganization_id = authrocket_membership_info.org_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