Commit 9172a24c by vulehuan

update code: continue insert products when an error has been occured

parent b044beed
......@@ -80,6 +80,7 @@ namespace :db do
price_currency = price.attributes["currency"]
price = price.text
begin
Product.create!(
name: name,
description: description,
......@@ -96,6 +97,9 @@ namespace :db do
product_category_id: category_id,
status: true
)
rescue
next
end
end
end
end
......
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