diff --git a/app/controllers/spree/admin/products_controller_decorator.rb b/app/controllers/spree/admin/products_controller_decorator.rb index b5903c5d..2e8ce37c 100644 --- a/app/controllers/spree/admin/products_controller_decorator.rb +++ b/app/controllers/spree/admin/products_controller_decorator.rb @@ -1,17 +1,18 @@ Spree::Admin::ProductsController.class_eval do update.before :set_stores + before_action :find_stores, only: [:update] - def update + private + + def set_stores + @product.store_ids = nil unless params[:product].key? :store_ids + end + + def find_stores store_ids = params[:product][:store_ids] if store_ids.present? params[:product][:store_ids] = store_ids.split(',') end - super end - private - - def set_stores - @product.store_ids = nil unless params[:product].key? :store_ids - end end