From 77c97ef2c1098d2c8deb8302b31a8bce30a84fff Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Mon, 1 Aug 2016 21:14:02 -0400 Subject: [PATCH] Update vehicle.rb --- app/models/vehicle.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/models/vehicle.rb b/app/models/vehicle.rb index 84b7ce2..233aa59 100644 --- a/app/models/vehicle.rb +++ b/app/models/vehicle.rb @@ -75,6 +75,11 @@ class Vehicle < ActiveRecord::Base write_attribute(:vin, val.to_s.upcase) end + # search for a vin + def self.search(search) + where("vin LIKE ?", "%#{search}%") + end + private # init method to pull JSON details from Edmunds @@ -122,8 +127,4 @@ class Vehicle < ActiveRecord::Base return v.slice(0,8) + v.slice(9,11) end - # search for a vin - def self.search(search) - where("vin LIKE ?", "%#{search}%") - end end