app/controllers/phcscriptcdnpro/script/licences_controller.rb in phcscriptcdnpro-74.0.0 vs app/controllers/phcscriptcdnpro/script/licences_controller.rb in phcscriptcdnpro-75.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
def index
- @script_licences = Script::Licence.all
+ @script_licences = Script::Licence.where(org_id: current_user.org_id)
end
# SHOW
def show
@script_licences = Script::Licence.friendly.find(params[:id])
@@ -31,9 +31,10 @@
# CREATE
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, :flash => { :success => 'Licence was successfully created.' }
else
render :new
end