mirror of
https://github.com/rickbarrette/redmine_qbo_vehicles.git
synced 2026-10-03 17:10:43 -04:00
record errors and decode existing vins on migration
This commit is contained in:
1 parent
8503c48944
commit
c38bced329
4 files changed
+69
-15
No files matched your search
@@ -76,10 +76,20 @@ class VehiclesController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
# used by the polling JS in vehicle#show
|
||||
def status
|
||||
vehicle = Vehicle.find(params[:id])
|
||||
|
||||
# decode the vin if it hasn't been done for some reason
|
||||
unless vehicle.vin_decoded
|
||||
if vehicle.error.nil?
|
||||
VehicleVinDecodeJob.perform_later(vehicle)
|
||||
end
|
||||
end
|
||||
|
||||
render json: {
|
||||
decoded: vehicle.vin_decoded
|
||||
decoded: vehicle.vin_decoded,
|
||||
error: vehicle.error
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user