From c8b21ed1d11a8559f57b2a70ab36973de8d5672c Mon Sep 17 00:00:00 2001 From: benji Date: Wed, 7 Oct 2015 15:34:22 +0200 Subject: [PATCH] Load barcode through product --- app/controllers/barcodes_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/barcodes_controller.rb b/app/controllers/barcodes_controller.rb index c0fcf57..d6782a1 100644 --- a/app/controllers/barcodes_controller.rb +++ b/app/controllers/barcodes_controller.rb @@ -1,5 +1,6 @@ class BarcodesController < ApplicationController - load_and_authorize_resource :barcode, shallow: true + load_and_authorize_resource :product + load_and_authorize_resource :barcode, through: :product def create @barcode.save