From 875ec19e38a61e90b7d497ae978f4428fe9917d1 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Mon, 1 Aug 2016 21:09:39 -0400 Subject: [PATCH] Update customer.rb --- app/models/customer.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/models/customer.rb b/app/models/customer.rb index 81c6c67..68c8a5d 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -18,8 +18,6 @@ class Customer < ActiveRecord::Base attr_accessible :name, :notes, :email, :primary_phone, :mobile_phone validates_presence_of :id, :name - acts_as_searchable :columns => ["#{table_name}.name"] - self.primary_key = :id # returns a human readable string @@ -142,9 +140,9 @@ class Customer < ActiveRecord::Base end end + # Searchs the database for a customer by name def self.search(search) where("name LIKE ?", "%#{search}%").order(:name) - #where("id LIKE ?", "%#{search}%") end # proforms a bruteforce sync operation