mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-31 06:31:41 +00:00
Fix easy rubocop issues
This commit is contained in:
@@ -91,7 +91,9 @@ module Spree
|
||||
Spree::OrderMailer.invoice_email(@order.id, pdf).deliver
|
||||
flash[:success] = t('admin.orders.invoice_email_sent')
|
||||
|
||||
respond_with(@order) { |format| format.html { redirect_to spree.edit_admin_order_path(@order) } }
|
||||
respond_with(@order) { |format|
|
||||
format.html { redirect_to spree.edit_admin_order_path(@order) }
|
||||
}
|
||||
end
|
||||
|
||||
def print
|
||||
@@ -131,7 +133,9 @@ module Spree
|
||||
|
||||
flash[:error] = t(:must_have_valid_business_number,
|
||||
enterprise_name: @order.distributor.name)
|
||||
respond_with(@order) { |format| format.html { redirect_to spree.edit_admin_order_path(@order) } }
|
||||
respond_with(@order) { |format|
|
||||
format.html { redirect_to spree.edit_admin_order_path(@order) }
|
||||
}
|
||||
end
|
||||
|
||||
def load_distribution_choices
|
||||
|
||||
@@ -61,17 +61,21 @@ module Spree
|
||||
@url_filters = ::ProductFilters.new.extract(request.query_parameters)
|
||||
|
||||
@variant = Spree::Variant.find(params[:id])
|
||||
flash[:success] = if VariantDeleter.new.delete(@variant)
|
||||
Spree.t('notice_messages.variant_deleted')
|
||||
else
|
||||
Spree.t('notice_messages.variant_not_deleted')
|
||||
end
|
||||
flash[:success] = delete_variant
|
||||
|
||||
redirect_to spree.admin_product_variants_url(params[:product_id], @url_filters)
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def delete_variant
|
||||
if VariantDeleter.new.delete(@variant)
|
||||
Spree.t('notice_messages.variant_deleted')
|
||||
else
|
||||
Spree.t('notice_messages.variant_not_deleted')
|
||||
end
|
||||
end
|
||||
|
||||
def create_before
|
||||
option_values = params[:new_variant]
|
||||
option_values.andand.each_value { |id| @object.option_values << OptionValue.find(id) }
|
||||
|
||||
Reference in New Issue
Block a user