1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-03 04:25:21 +02:00

Add sync status and errors to account settings page (#1169)

This commit is contained in:
Zach Gollwitzer 2024-09-11 17:24:01 -04:00 committed by GitHub
parent 86741401c3
commit b9341ac302
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 124 additions and 38 deletions

View file

@ -4,4 +4,22 @@ class Institution < ApplicationRecord
has_one_attached :logo
scope :alphabetically, -> { order(name: :asc) }
def sync
accounts.active.each do |account|
if account.needs_sync?
account.sync
end
end
update! last_synced_at: Time.now
end
def syncing?
accounts.active.any? { |account| account.syncing? }
end
def has_issues?
accounts.active.any? { |account| account.has_issues? }
end
end