Skip to content

Commit

Permalink
Uniform how we create sample store in deafult/sample data
Browse files Browse the repository at this point in the history
Also, we are not creating a store in migrations since solidusio#2229, but
populating database with default data and sample data (for example
creating the sandbox) is creating two different stores.
  • Loading branch information
kennyadsl committed Nov 25, 2017
1 parent 94a9159 commit 94352d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
15 changes: 7 additions & 8 deletions core/db/default/spree/stores.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Possibly already created by a migration.
unless Spree::Store.where(code: 'spree').exists?
Spree::Store.new do |s|
s.code = 'spree'
s.name = 'Sample Store'
s.url = 'example.com'
s.mail_from_address = '[email protected]'
end.save!
unless Spree::Store.where(code: 'sample-store').exists?
Spree::Store.create!(
name: "Sample Store",
code: "sample-store",
url: "example.com",
mail_from_address: "[email protected]"
)
end
14 changes: 8 additions & 6 deletions sample/db/samples/stores.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Spree::Store.create!(
name: "Sample Store",
code: "sample-store",
url: "solidus.example.com",
mail_from_address: "[email protected]"
)
unless Spree::Store.where(code: 'sample-store').exists?
Spree::Store.create!(
name: "Sample Store",
code: "sample-store",
url: "example.com",
mail_from_address: "[email protected]"
)
end

0 comments on commit 94352d8

Please sign in to comment.