Fix the settings page before QuickBooks is connected

The token expiry came back as "never synced" text, which the page treated as a
time, so it failed. It's now empty, shown as N/A.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-04 10:07:54 -05:00
1 parent 895733f534
commit 0a7b2e34b8
1 file changed
+3 -2
+3 -2
View File
@@ -23,16 +23,17 @@ class Qbo < ActiveRecord::Base
return I18n.t(:label_qbo_never_synced)
end
# Token expiry times, or nil when QuickBooks isn't connected (the settings page shows N/A)
def self.oauth2_access_token_expires_at
QboConnectionService.current!.oauth2_access_token_expires_at
rescue
return I18n.t(:label_qbo_never_synced)
nil
end
def self.oauth2_refresh_token_expires_at
QboConnectionService.current!.oauth2_refresh_token_expires_at
rescue
return I18n.t(:label_qbo_never_synced)
nil
end
# Updates last sync time stamp