Make sample data vegetarian

This commit is contained in:
Luis Ramos
2020-08-31 10:57:07 +01:00
parent a029a86f0d
commit 3df5a0644f
2 changed files with 4 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ class ProductFactory
def product_data(enterprises)
vegetables = Spree::Taxon.find_by(name: 'Vegetables')
fruit = Spree::Taxon.find_by(name: 'Fruit')
meat = Spree::Taxon.find_by(name: 'Meat and Fish')
fungi = Spree::Taxon.find_by(name: 'Fungi')
producers = enterprises.select(&:is_primary_producer)
distributors = enterprises.select(&:is_distributor)
[
@@ -34,10 +34,10 @@ class ProductFactory
distributor: distributors[0]
},
{
name: 'Beef - 5kg Trays',
name: 'Mushrooms',
price: 50.00,
supplier: producers[1],
taxons: [meat],
taxons: [fungi],
distributor: distributors[0]
},
{

View File

@@ -6,7 +6,7 @@ class TaxonFactory
def create_samples
log "Creating taxonomies:"
taxonomy = Spree::Taxonomy.find_or_create_by!(name: 'Products')
taxons = ['Vegetables', 'Fruit', 'Oils', 'Preserves and Sauces', 'Dairy', 'Meat and Fish']
taxons = ['Vegetables', 'Fruit', 'Oils', 'Preserves and Sauces', 'Dairy', 'Fungi']
taxons.each do |taxon_name|
create_taxon(taxonomy, taxon_name)
end