Update app/models/spree/line_item.rb

Co-authored-by: Maikel <maikel@email.org.au>
This commit is contained in:
Matt-Yorkley
2023-05-08 08:26:57 +01:00
parent 7f5d1be792
commit 0ac10472cf

View File

@@ -40,7 +40,7 @@ module Spree
before_save :calculate_final_weight_volume, if: :quantity_changed?,
unless: :final_weight_volume_changed?
before_save :assign_units, if: ->(line_item) {
line_item.new_record? || line_item.changed_attributes.keys.include?("final_weight_volume")
line_item.new_record? || line_item.final_weight_volume_changed?
}
before_destroy :update_inventory_before_destroy