mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-28 01:53:25 +00:00
Fix loading of initial data to ensure there is an itemwise shipping method.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user