app/controllers/phcscriptcdnpro/script/versions_controller.rb in phcscriptcdnpro-28.0.0 vs app/controllers/phcscriptcdnpro/script/versions_controller.rb in phcscriptcdnpro-29.0.0
- old
+ new
@@ -2,12 +2,11 @@
module Phcscriptcdnpro
class Script::VersionsController < 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_version, only: [:show, :edit, :update, :destroy]
# INDEX - Script Versions
def index
@@ -21,35 +20,33 @@
end
# NEW - Script Versions
def new
@script_version = Script::Version.new
+ @script_version.user_id = current_user.id
+ @script_version.org_id = current_user.org_id
end
# EDIT - Script Versions
def edit
end
# POST - Script Versions
def create
@script_version = Script::Version.new(script_version_params)
@script_version.user_id = current_user.id
- @script_version.user_name = current_user.username
- @script_version.membership_id = authrocket_membership_info.id
- @script_version.oganization_id = authrocket_membership_info.org_id
+ @script_version.org_id = current_user.org_id
if @script_version.save
redirect_to script_versions_url, notice: 'Version was successfully created.'
else
render :new
end
end
# PATCH/PUT - Script Versions
def update
@script_version.user_id = current_user.id
- @script_version.user_name = current_user.username
- @script_version.membership_id = authrocket_membership_info.id
- @script_version.oganization_id = authrocket_membership_info.org_id
+ @script_version.org_id = current_user.org_id
if @script_version.update(script_version_params)
redirect_to script_versions_url, notice: 'Version was successfully updated.'
else
render :edit
end