Update qbo.rb

This commit is contained in:
2020-01-04 22:30:43 -05:00
committed by GitHub
parent fd85f296de
commit 725d511be5

View File

@@ -39,7 +39,8 @@ class Qbo < ActiveRecord::Base
# check to see if we need to refest the token
if qbo.expire.to_date.past?
new_access_token_object = access_token.refresh!
qbo.token = new_access_token_object
Qbo.qb_token = new_access_token_object.token
qbo.qb_secret = new_access_token_object.refresh_token
qbo.expire = 1.hour.from_now.utc
qbo.save!
access_token = new_access_token_object