mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-04 02:31:33 +00:00
Revert "Fix 9 Rubocop violations (Rails/Presence and Rails/RedirectBackOrTo)Fix rubocop violations"
This commit is contained in:
@@ -177,7 +177,7 @@ module Admin
|
||||
protected
|
||||
|
||||
def delete_custom_tab
|
||||
@object.custom_tab.presence&.destroy
|
||||
@object.custom_tab.destroy if @object.custom_tab.present?
|
||||
enterprise_params.delete(:custom_tab_attributes)
|
||||
end
|
||||
|
||||
@@ -240,7 +240,9 @@ module Admin
|
||||
enterprises = OpenFoodNetwork::OrderCyclePermissions.new(spree_current_user, @order_cycle)
|
||||
.visible_enterprises
|
||||
|
||||
enterprises.presence&.includes(supplied_products: [:variants, :image])
|
||||
if enterprises.present?
|
||||
enterprises.includes(supplied_products: [:variants, :image])
|
||||
end
|
||||
when :index
|
||||
if spree_current_user.admin?
|
||||
OpenFoodNetwork::Permissions.new(spree_current_user).
|
||||
|
||||
@@ -209,7 +209,7 @@ module Admin
|
||||
elsif params[:context] == "checkout_options" && params[:save_and_back_to_list]
|
||||
redirect_to main_app.admin_order_cycles_path
|
||||
else
|
||||
redirect_back_or_to(root_path)
|
||||
redirect_back(fallback_location: root_path)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user