mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-09 17:34:23 -05:00
Update vehicle.rb
This commit is contained in:
@@ -48,12 +48,16 @@ class Vehicle < ActiveRecord::Base
|
|||||||
return @details['numOfDoors'] if @details
|
return @details['numOfDoors'] if @details
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Force Upper Case for VIN numbers
|
||||||
|
def self.vin=(val)
|
||||||
|
self.vin = val.upcase
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# init method to pull JSON details from Edmunds
|
# init method to pull JSON details from Edmunds
|
||||||
def get_details
|
def get_details
|
||||||
if self.vin?
|
if self.vin?
|
||||||
self.vin = self.vin.upcase
|
|
||||||
begin
|
begin
|
||||||
@details = JSON.parse get_decoder.full(self.vin)
|
@details = JSON.parse get_decoder.full(self.vin)
|
||||||
raise @details['message'] if @details['status'] == "NOT_FOUND"
|
raise @details['message'] if @details['status'] == "NOT_FOUND"
|
||||||
|
|||||||
Reference in New Issue
Block a user