diff --git a/sample/db/samples/taxonomies.rb b/sample/db/samples/taxonomies.rb index 8ceada0cf5e..3c4614b6131 100644 --- a/sample/db/samples/taxonomies.rb +++ b/sample/db/samples/taxonomies.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -store = Spree::Store.find_by!(code: 'sample-store') +store = Spree::Store.where(code: 'sample-store').first taxonomies = [ { name: "Categories", store: }, diff --git a/sample/db/samples/taxons.rb b/sample/db/samples/taxons.rb index b50dc3da995..cca32012d4c 100644 --- a/sample/db/samples/taxons.rb +++ b/sample/db/samples/taxons.rb @@ -4,7 +4,6 @@ Spree::Sample.load_sample("products") categories = Spree::Taxonomy.find_by!(name: "Categories") -brands = Spree::Taxonomy.find_by!(name: "Brands") products = { solidus_bottles: "Solidus Water Bottle", @@ -26,10 +25,46 @@ end taxons = [ + { + name: "Brands", + taxonomy: brands + }, + { + name: "Solidus", + taxonomy: brands, + parent: "Brands", + products: [ + products[:solidus_bottles], + products[:solidus_tote], + products[:solidus_hoodie], + products[:solidus_mug_set], + products[:solidus_hat], + products[:solidus_sticker], + products[:solidus_notebook], + products[:solidus_tshirt], + products[:solidus_long_sleeve_tee], + products[:solidus_dark_tee], + products[:solidus_bottles], + products[:solidus_canvas_tote], + products[:solidus_cap] + ] + }, { name: "Categories", taxonomy: categories, }, + { + name: "Brands", + taxonomy: brands, + }, + { + name: "Solidus", + taxonomy: categories, + parent: "Brands", + products: [ + products[:solidus_cap] + ] + }, { name: "Clothing", taxonomy: categories, @@ -86,7 +121,7 @@ }, { name: "Hoodies", - taxonomy: brands, + taxonomy: categories, parent: "Clothing", products: [ products[:solidus_hoodie],