show all vehicles if search is blank

This commit is contained in:
2026-03-26 07:21:05 -04:00
parent 44bfb69e22
commit 8503c48944

View File

@@ -47,7 +47,6 @@ class Vehicle < ApplicationRecord
end
def self.search(query)
return none if query.blank?
q = "%#{sanitize_sql_like(query)}%"
where( "vin LIKE :q OR make LIKE :q OR model LIKE :q OR year LIKE :q", q: q)
end