Update vehicle.rb

This commit is contained in:
ricky authored and GitHub committed 2016-09-06 10:56:30 -05:00
1 parent 5b56d7a878
commit 00285e1f24
1 file changed
+2 -2
+2 -2
View File
@@ -87,8 +87,8 @@ class Vehicle < ActiveRecord::Base
if self.vin? if self.vin?
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'].to_s.eql? "NOT_FOUND"
raise @details['message'] if @details['status'] == "BAD_REQUEST" raise @details['message'] if @details['status'].to_s.eql? "BAD_REQUEST"
rescue Exception => e rescue Exception => e
errors.add(:vin, e.message) errors.add(:vin, e.message)
end end