Fix loading of initial data to ensure there is an itemwise shipping method.

This commit is contained in:
Andrew Spinks
2013-08-01 10:31:17 +10:00
parent 65617e0e77
commit 287bd57a4e
2 changed files with 7 additions and 1 deletions

View File

@@ -44,6 +44,10 @@ Create the development and test databases, using the settings specified in `conf
rake db:schema:load db:seed
Load some default data for your environment
rake openfoodweb:dev:load_sample_data
At long last, your dreams of spinning up a development server can be realised:
rails server

View File

@@ -30,7 +30,6 @@ namespace :openfoodweb do
end
end
# -- Enterprises
unless Enterprise.count > 0
puts "[db:seed] Seeding enterprises"
@@ -39,6 +38,9 @@ namespace :openfoodweb do
3.times { FactoryGirl.create(:distributor_enterprise) }
end
unless Spree::ShippingMethod.all.any? { |sm| sm.calculator.is_a? OpenFoodWeb::Calculator::Itemwise }
FactoryGirl.create(:itemwise_shipping_method)
end
# -- Products
unless Spree::Product.count > 0