From 5b8eb681699d97fed8ce4a1e9731b756877dc4c0 Mon Sep 17 00:00:00 2001 From: phyusin Date: Mon, 25 Jun 2018 11:25:24 +0630 Subject: [PATCH] check image is avail: --- app/models/menu.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/menu.rb b/app/models/menu.rb index 38cf80dd..ee9414a9 100755 --- a/app/models/menu.rb +++ b/app/models/menu.rb @@ -193,7 +193,7 @@ class Menu < ApplicationRecord end image_path = "" - if row["Image Path"] != "" + if row["Image Path"] && row["Image Path"] != "" image_path = URI.parse('public/image/menu_images/'+row["Image Path"]) end menu_itm = MenuItem.create(item_code: row["Item Code"], name: row["Item Name"], account_id: account.id, alt_name: row["Item AltName"], image_path: image_path, description: '', information: '', unit: '', type: "SimpleMenuItem", menu_category_id: menu_cat.id, item_attributes: item_attrs, item_options: item_opts, is_sub_item: 0, is_available: 1, created_by: created_by)