make contacts searchable

This commit is contained in:
Vladimir Krylov 2015-10-22 09:49:36 +03:00
parent b088d39b0e
commit 3d2c9c01a6
7 changed files with 56 additions and 12 deletions

View file

@ -345,6 +345,10 @@ class Contact < ActiveRecord::Base
end
end
def search_name
"#{code} #{name}"
end
def set_linked
statuses << LINKED if statuses.detect { |s| s == LINKED }.blank?
end