mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-09 01:14:23 -05:00
Update customer.rb
This commit is contained in:
@@ -18,8 +18,6 @@ class Customer < ActiveRecord::Base
|
|||||||
attr_accessible :name, :notes, :email, :primary_phone, :mobile_phone
|
attr_accessible :name, :notes, :email, :primary_phone, :mobile_phone
|
||||||
validates_presence_of :id, :name
|
validates_presence_of :id, :name
|
||||||
|
|
||||||
acts_as_searchable :columns => ["#{table_name}.name"]
|
|
||||||
|
|
||||||
self.primary_key = :id
|
self.primary_key = :id
|
||||||
|
|
||||||
# returns a human readable string
|
# returns a human readable string
|
||||||
@@ -142,9 +140,9 @@ class Customer < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Searchs the database for a customer by name
|
||||||
def self.search(search)
|
def self.search(search)
|
||||||
where("name LIKE ?", "%#{search}%").order(:name)
|
where("name LIKE ?", "%#{search}%").order(:name)
|
||||||
#where("id LIKE ?", "%#{search}%")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# proforms a bruteforce sync operation
|
# proforms a bruteforce sync operation
|
||||||
|
|||||||
Reference in New Issue
Block a user