Skip to content

Commit

Permalink
Add the ability to run the seeds multiple times
Browse files Browse the repository at this point in the history
We have to have the ability to run the seeds multiple time without it
giving errors about records were already existing.
  • Loading branch information
thisiscab committed Oct 9, 2015
1 parent f02bbf9 commit da59bf4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/db/default/spree/zones.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
eu_vat = Spree::Zone.create!(name: "EU_VAT", description: "Countries that make up the EU VAT zone.")
north_america = Spree::Zone.create!(name: "North America", description: "USA + Canada")
eu_vat = Spree::Zone.find_or_create_by!(name: "EU_VAT", description: "Countries that make up the EU VAT zone.")
north_america = Spree::Zone.find_or_create_by!(name: "North America", description: "USA + Canada")

["Poland", "Finland", "Portugal", "Romania", "Germany", "France",
"Slovakia", "Hungary", "Slovenia", "Ireland", "Austria", "Spain",
Expand Down
2 changes: 1 addition & 1 deletion sample/db/samples/tax_categories.rb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Spree::TaxCategory.create!(:name => "Default")
Spree::TaxCategory.create!(:name => Spree::TaxCategory.find_by!(:name => "Default"))

0 comments on commit da59bf4

Please sign in to comment.