mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Remove use of before_filter
This commit is contained in:
@@ -5,7 +5,6 @@ Spree::Admin::ProductsController.class_eval do
|
||||
include OpenFoodNetwork::SpreeApiKeyLoader
|
||||
include OrderCyclesHelper
|
||||
include EnterprisesHelper
|
||||
before_filter :latest_import, only: [:bulk_edit]
|
||||
before_filter :load_form_data, :only => [:bulk_edit, :new, :create, :edit, :update]
|
||||
before_filter :load_spree_api_key, :only => [:bulk_edit, :variant_overrides]
|
||||
before_filter :strip_new_properties, only: [:create, :update]
|
||||
@@ -25,6 +24,10 @@ Spree::Admin::ProductsController.class_eval do
|
||||
def product_distributions
|
||||
end
|
||||
|
||||
def bulk_edit
|
||||
@show_latest_import = params[:latest_import] || false
|
||||
end
|
||||
|
||||
def bulk_update
|
||||
collection_hash = Hash[params[:products].each_with_index.map { |p,i| [i,p] }]
|
||||
product_set = Spree::ProductSet.new({:collection_attributes => collection_hash})
|
||||
@@ -94,10 +97,6 @@ Spree::Admin::ProductsController.class_eval do
|
||||
|
||||
private
|
||||
|
||||
def latest_import
|
||||
@show_latest_import = params[:latest_import] || false
|
||||
end
|
||||
|
||||
def load_form_data
|
||||
@producers = OpenFoodNetwork::Permissions.new(spree_current_user).managed_product_enterprises.is_primary_producer.by_name
|
||||
@taxons = Spree::Taxon.order(:name)
|
||||
|
||||
Reference in New Issue
Block a user