mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-09 01:14:23 -05:00
Merge branch 'master' of github.com:rickbarrette/redmine_qbo
This commit is contained in:
@@ -107,7 +107,12 @@ 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?
|
||||||
|
#validate the vin before calling a remote server
|
||||||
|
validation = NhtsaVin.validate(self.vin)
|
||||||
begin
|
begin
|
||||||
|
#if the vin validation failed, raise an exception and exit
|
||||||
|
raise RuntimeError, validation.error unless validation.valid?
|
||||||
|
# query NHTSA for details on the vin
|
||||||
query = NhtsaVin.get(self.vin)
|
query = NhtsaVin.get(self.vin)
|
||||||
raise RuntimeError, query.error unless query.valid?
|
raise RuntimeError, query.error unless query.valid?
|
||||||
@details = query.response
|
@details = query.response
|
||||||
|
|||||||
Reference in New Issue
Block a user