Update units when variant unit name is edited

This commit is contained in:
Nihal M. Kelanthodika
2021-12-15 12:30:10 +05:30
parent ba1e810a3c
commit 44c3820a8f

View File

@@ -431,7 +431,7 @@ module Spree
end
def update_units
return unless saved_change_to_variant_unit?
return unless saved_change_to_variant_unit? || saved_change_to_variant_unit_name?
option_types.delete self.class.all_variant_unit_option_types
option_types << variant_unit_option_type if variant_unit.present?