Remove non-functional :backend scope from Spree::ShippingRate

It finds shipping methods where 'display_on != front_end' but :front_end values were removed in a1317be19b/db/migrate/20200508101630_convert_frontend_shipping_method_to_both.rb so it will always return true.
This commit is contained in:
Cillian O'Ruanaidh
2022-06-08 19:54:28 +01:00
committed by Filipe
parent 9b5f743fa5
commit 37617f63ea
2 changed files with 1 additions and 8 deletions

View File

@@ -12,13 +12,6 @@ module Spree
references(:shipping_method).
order("cost ASC")
}
scope :backend,
-> {
includes(:shipping_method).
where(ShippingMethod.on_backend_query).
references(:shipping_method).
order("cost ASC")
}
delegate :order, :currency, to: :shipment
delegate :name, to: :shipping_method

View File

@@ -38,7 +38,7 @@
%td{ :colspan => "5" }
%div.field.alpha.five.columns
= label_tag 'selected_shipping_rate_id', Spree.t(:shipping_method)
= select_tag :selected_shipping_rate_id, options_for_select(shipment.shipping_rates.backend.map { |sr| ["#{sr.name} #{sr.display_price}", sr.id] }, shipment.selected_shipping_rate_id), { :class => 'select2 fullwidth', :data => { 'shipment-number' => shipment.number } }
= select_tag :selected_shipping_rate_id, options_for_select(shipment.shipping_rates.map { |sr| ["#{sr.name} #{sr.display_price}", sr.id] }, shipment.selected_shipping_rate_id), { :class => 'select2 fullwidth', :data => { 'shipment-number' => shipment.number } }
%td.actions
- if can? :update, shipment