Skip to content

Commit

Permalink
Merge pull request #2405 from nebulab/fix-default-store
Browse files Browse the repository at this point in the history
Uniform how we create sample store in deafult and sample data
  • Loading branch information
jhawthorn authored Nov 27, 2017
2 parents 40a8ac2 + 94352d8 commit 2116839
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 = 'store@example.com'
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: "store@example.com"
)
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: "store@example.com"
)
unless Spree::Store.where(code: 'sample-store').exists?
Spree::Store.create!(
name: "Sample Store",
code: "sample-store",
url: "example.com",
mail_from_address: "store@example.com"
)
end

0 comments on commit 2116839

Please sign in to comment.