move all_units to admin helper

This commit is contained in:
Andy Brett
2020-10-06 17:29:44 -07:00
parent fa62ec0bff
commit 4f579facfe
2 changed files with 4 additions and 1 deletions

View File

@@ -8,6 +8,10 @@ module Spree
end
options_from_collection_for_select(currencies, :first, :last, Spree::Config[:currency])
end
def all_units
["g", "oz", "lb", "kg", "T", "mL", "L", "kL"]
end
end
end
end

View File

@@ -90,7 +90,6 @@
%fieldset.available_units.no-border-bottom
%legend{:align => "center"}= t('admin.available_units')
.field
- all_units = ["g", "oz", "lb", "kg", "T", "mL", "L", "kL"]
- selected_units = Spree::Config[:available_units].split(",")
- all_units.each do |unit|
- selected = selected_units.include?(unit)