app/controllers/phcscriptcdnpro/script/extensions_controller.rb in phcscriptcdnpro-11.1.1 vs app/controllers/phcscriptcdnpro/script/extensions_controller.rb in phcscriptcdnpro-11.2.0
- old
+ new
@@ -1,23 +1,25 @@
require_dependency "phcscriptcdnpro/application_controller"
module Phcscriptcdnpro
class Script::ExtensionsController < ApplicationController
- # Filters & Security
+ # Security & Action Filters
before_action :require_user
- before_action :membership_info
+ before_action :authrocket_membership_info
+ before_action :set_paper_trail_whodunnit
before_action :set_script_extension, only: [:show, :edit, :update, :destroy]
# INDEX - Script Extension
def index
- @script_extensions = Script::Extension.all
+ @script_extensions = Script::Extension.where(oganization_id: membership_info.org_id)
end
# DETAILS - Script Extension
def show
@script_extensions = Script::Extension.friendly.find(params[:id])
+ @versions = PaperTrail::Version.where(item_id: params[:id], item_type: 'Phcmemberspro::Directory::Category')
end
# NEW - Script Extension
def new
@script_extension = Script::Extension.new
@@ -67,10 +69,10 @@
@script_extension = Script::Extension.friendly.find(params[:id])
end
# Whitelists
def script_extension_params
- params.require(:script_extension).permit(:scriptextensionname, :scriptextensiondes, :scriptextension, :user_id, :user_name, :slug, :membership_id, :oganization_id)
+ params.require(:script_extension).permit(:scriptextensionname, :scriptextensiondes, :scriptextension, :slug, :user_id, :user_name, :membership_id, :oganization_id)
end
end
end