Commit 295d4ac9 by vulehuan

update code: create user before insert products (product belongs to user)

parent 9172a24c
......@@ -34,6 +34,16 @@ namespace :db do
)
end
# Create admin account (product belongs to user)
@user = User.new(
name: "admin",
email: "admin@local.net",
admin: true,
password: "123456",
password_confirmation: "123456"
)
@user.save
# Product list
# http://developer.yahoo.co.jp/webapi/shopping/shopping/v1/itemsearch.html
list_url = 'http://shopping.yahooapis.jp/ShoppingWebService/V1/itemSearch'
......@@ -95,6 +105,7 @@ namespace :db do
price_currency: price_currency,
price: price,
product_category_id: category_id,
user_id: @user.id,
status: true
)
rescue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment