mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
use #destroy_all
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
class MigrateVariantUnitValues < ActiveRecord::Migration
|
||||
def up
|
||||
Spree::Variant.where(product_id: nil).find_each do |variant|
|
||||
variant.destroy
|
||||
end
|
||||
Spree::Variant.where(product_id: nil).destroy_all
|
||||
Spree::Variant.where(unit_value: [nil, Float::NAN]).find_each do |variant|
|
||||
variant.unit_value = 1
|
||||
variant.save
|
||||
|
||||
Reference in New Issue
Block a user