Merge pull request #6834 from andrewpbrett/fix-variants-with-no-products

Remove variants with no product
This commit is contained in:
Pau Pérez Fabregat
2021-02-09 12:07:54 +01:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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"