update customer search in card no

This commit is contained in:
Aung Myo
2017-06-21 18:30:51 +06:30
parent 3ba836b446
commit a6912d4e5b

View File

@@ -64,7 +64,7 @@ class Customer < ApplicationRecord
def self.search(search) def self.search(search)
if search if search
# find(:all, :conditions => ['name LIKE ? OR contact_no LIKE ?', "%#{search}%", "%#{search}%"]) # find(:all, :conditions => ['name LIKE ? OR contact_no LIKE ?', "%#{search}%", "%#{search}%"])
where("name LIKE ? OR contact_no LIKE ? OR card_no LIKE ?", "%#{search}%", "%#{search}%",) where("name LIKE ? OR contact_no LIKE ? OR card_no LIKE ?", "%#{search}%", "%#{search}%", "%#{search}%",)
else else
find(:all) find(:all)
end end