mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-21 05:09:15 +00:00
Merge pull request #6834 from andrewpbrett/fix-variants-with-no-products
Remove variants with no product
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
class MigrateVariantUnitValues < ActiveRecord::Migration
|
||||
def up
|
||||
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
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
|
||||
ActiveRecord::Schema.define(version: 20210203215049) do
|
||||
ActiveRecord::Schema.define(version: 20210203214304) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
Reference in New Issue
Block a user