4 Commits

2 changed files with 3 additions and 6 deletions

View File

@@ -92,14 +92,11 @@ class Vehicle < ActiveRecord::Base
scope = self.all
tokens.each do |token|
q = "%#{sanitize_sql_like(token)}%"
scope = where("vin LIKE ? OR make LIKE ? OR model LIKE ? OR year LIKE ?", "%#{q}%", "%#{q}%", "%#{q}%", "%#{q}%")
scope = scope.search(token)
end
ids = scope.distinct.limit(options[:limit] || 100).pluck(:id)
# rank by id
ids.each_with_object({}) { |id, h| h[id] = id }
ids.index_with { |id| id }
end
# returns a human readable string

View File

@@ -14,7 +14,7 @@ Redmine::Plugin.register :redmine_qbo_vehicles do
name 'Redmine QBO Vehicles plugin'
author 'Rick Barrette'
description 'This is a plugin for Redmine to intergrate with the redmine_qbo plugin to provide vehicle data tracking'
version '2026.2.6'
version '2026.2.8'
url 'https://github.com/rickbarrette/redmine_qbo_vehicles'
author_url 'https://barrettefabrication.com'
requires_redmine version_or_higher: '6.1.0'