mirror of
https://github.com/rickbarrette/redmine_qbo_vehicles.git
synced 2026-04-02 07:01:59 -04:00
Compare commits
4 Commits
9ee792cbd8
...
2026.2.8
| Author | SHA1 | Date | |
|---|---|---|---|
| e0fc07141c | |||
| 3e6c2672e0 | |||
| 71bde3a249 | |||
| 4f2ae19460 |
@@ -92,14 +92,11 @@ class Vehicle < ActiveRecord::Base
|
|||||||
scope = self.all
|
scope = self.all
|
||||||
|
|
||||||
tokens.each do |token|
|
tokens.each do |token|
|
||||||
q = "%#{sanitize_sql_like(token)}%"
|
scope = scope.search(token)
|
||||||
scope = where("vin LIKE ? OR make LIKE ? OR model LIKE ? OR year LIKE ?", "%#{q}%", "%#{q}%", "%#{q}%", "%#{q}%")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
ids = scope.distinct.limit(options[:limit] || 100).pluck(:id)
|
ids = scope.distinct.limit(options[:limit] || 100).pluck(:id)
|
||||||
|
ids.index_with { |id| id }
|
||||||
# rank by id
|
|
||||||
ids.each_with_object({}) { |id, h| h[id] = id }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# returns a human readable string
|
# returns a human readable string
|
||||||
|
|||||||
2
init.rb
2
init.rb
@@ -14,7 +14,7 @@ Redmine::Plugin.register :redmine_qbo_vehicles do
|
|||||||
name 'Redmine QBO Vehicles plugin'
|
name 'Redmine QBO Vehicles plugin'
|
||||||
author 'Rick Barrette'
|
author 'Rick Barrette'
|
||||||
description 'This is a plugin for Redmine to intergrate with the redmine_qbo plugin to provide vehicle data tracking'
|
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'
|
url 'https://github.com/rickbarrette/redmine_qbo_vehicles'
|
||||||
author_url 'https://barrettefabrication.com'
|
author_url 'https://barrettefabrication.com'
|
||||||
requires_redmine version_or_higher: '6.1.0'
|
requires_redmine version_or_higher: '6.1.0'
|
||||||
|
|||||||
Reference in New Issue
Block a user