Skip to content

Commit

Permalink
Stop spree_sample:load creating a duplicate record
Browse files Browse the repository at this point in the history
Spree::ShippingCategory.create!(:name => "Default") is run in the following migration https://github.com/spree/spree/blob/master/core/db/migrate/20130830001033_add_shipping_category_to_shipping_methods_and_products.rb therefore a create command here would create a duplicate if a db:migrate had been run prior. shipping_categories.rb could be removed from samples completely but users of db:reset (that uses db:schema:load and loads the db from schema not migrations) would need it to be created here.

Fixes solidusio#5161
  • Loading branch information
albertstill authored and Jeff Dutil committed Aug 7, 2014
1 parent f6dc027 commit 284343c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sample/db/samples/shipping_categories.rb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Spree::ShippingCategory.create!(:name => "Default")
Spree::ShippingCategory.find_or_create_by!(:name => "Default")

0 comments on commit 284343c

Please sign in to comment.