Fixed bug

This commit is contained in:
2016-04-28 08:57:15 -04:00
parent 3a64e0d5bd
commit b95aa41b3d

View File

@@ -28,7 +28,11 @@ class Vehicle < ActiveRecord::Base
end
def style
return @details['years'][0]['styles'][0]['name'] if @details
begin
return @details['years'][0]['styles'][0]['name'] if @details
rescue
return nil
end
end
def drive
@@ -53,6 +57,7 @@ class Vehicle < ActiveRecord::Base
end
def decode_vin
get_details
if self.vin?
details
self.year = @details['years'][0]['year']