Skip to content

Commit

Permalink
Merge pull request #8607 from spark-solutions/fix-samples-taxons-filt…
Browse files Browse the repository at this point in the history
…ering

Fix method responsible for filtering by taxon
  • Loading branch information
bbonislawski committed Feb 14, 2018
2 parents 879bb7c + 38f13c6 commit 24e4b39
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions sample/db/samples/taxons.rb
Expand Up @@ -139,9 +139,10 @@
taxons.each do |taxon_attrs|
parent = Spree::Taxon.where(name: taxon_attrs[:parent]).first
taxonomy = taxon_attrs[:taxonomy]
Spree::Taxon.where(name: taxon_attrs[:name]).first_or_create! do |taxon|
taxon.parent = parent
taxon.taxonomy = taxonomy
taxon.products = taxon_attrs[:products] if taxon_attrs[:products]
end

taxon = Spree::Taxon.where(name: taxon_attrs[:name]).first_or_create!
taxon.parent = parent
taxon.taxonomy = taxonomy
taxon.save
taxon.products = taxon_attrs[:products] if taxon_attrs[:products]
end

0 comments on commit 24e4b39

Please sign in to comment.