check product account
This commit is contained in:
@@ -5,13 +5,13 @@ class Product < ApplicationRecord
|
|||||||
mount_uploader :image_path, ProductImageUploader
|
mount_uploader :image_path, ProductImageUploader
|
||||||
|
|
||||||
def self.search_by_product_code(item_code)
|
def self.search_by_product_code(item_code)
|
||||||
account = Account.where('title','like','%Product%').first()
|
account = Account.find_by_title('Product')
|
||||||
if !account.nil?
|
if !account.nil?
|
||||||
account_id = account.id
|
account_id = account.id
|
||||||
else
|
else
|
||||||
account_id = 1
|
account_id = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
menu_item_hash = Hash.new
|
menu_item_hash = Hash.new
|
||||||
mt_instance = Product.find_by_item_code(item_code)
|
mt_instance = Product.find_by_item_code(item_code)
|
||||||
if (!mt_instance.nil?)
|
if (!mt_instance.nil?)
|
||||||
|
|||||||
Reference in New Issue
Block a user