mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Sort Product categories alphabetically by name and fixsample data by fixing taxons taxonomy id
This commit is contained in:
@@ -2,5 +2,5 @@
|
||||
= f.label :primary_taxon_id, t('.product_category')
|
||||
%span.required *
|
||||
%br
|
||||
= f.collection_select(:primary_taxon_id, Spree::Taxon.all, :id, :name, {:include_blank => true}, {:class => "select2 fullwidth"})
|
||||
= f.collection_select(:primary_taxon_id, Spree::Taxon.order(:name), :id, :name, {:include_blank => true}, {:class => "select2 fullwidth"})
|
||||
= f.error_message_on :primary_taxon_id
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace :openfoodnetwork do
|
||||
taxonomy_root = taxonomy.root
|
||||
|
||||
['Vegetables', 'Fruit', 'Oils', 'Preserves and Sauces', 'Dairy', 'Meat and Fish'].each do |taxon_name|
|
||||
FactoryBot.create(:taxon, name: taxon_name, parent_id: taxonomy_root.id)
|
||||
FactoryBot.create(:taxon, name: taxon_name, parent_id: taxonomy_root.id, taxonomy_id: taxonomy.id)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user