check product account

This commit is contained in:
phyusin
2018-03-05 15:00:18 +06:30
parent 88ff4313cb
commit e252c0acc3

View File

@@ -5,7 +5,7 @@ class Product < ApplicationRecord
mount_uploader :image_path, ProductImageUploader
def self.search_by_product_code(item_code)
account = Account.where('title','like','%Product%').first()
account = Account.find_by_title('Product')
if !account.nil?
account_id = account.id
else