db/samples/taxonomies.rb in spree_sample-4.5.5 vs db/samples/taxonomies.rb in spree_sample-4.6.0
- old
+ new
@@ -6,7 +6,11 @@
store: Spree::Store.default
}
]
taxonomies.each do |taxonomy_attrs|
- Spree::Taxonomy.where(taxonomy_attrs).first_or_create!
+ if Spree::Taxonomy.where(taxonomy_attrs).any?
+ Spree::Taxonomy.where(taxonomy_attrs).first
+ else
+ Spree::Taxonomy.create!(taxonomy_attrs)
+ end
end