mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Remove old do_not_remove_referenced_fees method
This commit is contained in:
@@ -2,7 +2,6 @@ module Admin
|
||||
class EnterpriseFeesController < ResourceController
|
||||
before_filter :load_enterprise_fee_set, :only => :index
|
||||
before_filter :load_data
|
||||
before_filter :do_not_destroy_referenced_fees, :only => :destroy
|
||||
|
||||
|
||||
def index
|
||||
@@ -45,22 +44,6 @@ module Admin
|
||||
|
||||
private
|
||||
|
||||
def do_not_destroy_referenced_fees
|
||||
product_distribution = ProductDistribution.where(:enterprise_fee_id => @object).first
|
||||
if product_distribution
|
||||
p = product_distribution.product
|
||||
error = I18n.t(:enterprise_fees_destroy_error, id: p.id, name: p.name)
|
||||
|
||||
respond_with(@object) do |format|
|
||||
format.html do
|
||||
flash[:error] = error
|
||||
redirect_to collection_url
|
||||
end
|
||||
format.js { render text: error, status: 403 }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def load_enterprise_fee_set
|
||||
@enterprise_fee_set = EnterpriseFeeSet.new :collection => collection
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user