Update vehicle.rb

This commit is contained in:
2016-08-01 19:04:46 -04:00
committed by GitHub
parent ddd00a3e9a
commit 632b788082

View File

@@ -121,4 +121,9 @@ class Vehicle < ActiveRecord::Base
v = self.vin[0,11]
return v.slice(0,8) + v.slice(9,11)
end
# search for a vin
def self.search(search)
where("vin LIKE ?", "%#{search}%")
end
end