mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-02 21:57:17 +00:00
Make sample data vegetarian
This commit is contained in:
@@ -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]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user