1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 05:09:38 +02:00

Only run Plaid syncs via webhook after initial sync
Some checks are pending
Publish Docker image / ci (push) Waiting to run
Publish Docker image / Build docker image (push) Blocked by required conditions

This commit is contained in:
Zach Gollwitzer 2025-05-12 18:55:19 -04:00
parent 908b3e2489
commit 9e6e4b1ce6
5 changed files with 14 additions and 33 deletions

View file

@ -74,11 +74,6 @@ class Family < ApplicationRecord
account.sync_later(start_date: start_date, parent_sync: sync)
end
Rails.logger.info("Syncing plaid items for family #{id}")
plaid_items.each do |plaid_item|
plaid_item.sync_later(start_date: start_date, parent_sync: sync)
end
Rails.logger.info("Applying rules for family #{id}")
rules.each do |rule|
rule.apply_later

View file

@ -2,15 +2,16 @@
<h1 class="text-xl"><%= t(".accounts") %></h1>
<div class="flex items-center gap-5">
<div class="flex items-center gap-2">
<%= render ButtonComponent.new(
text: "Sync all",
href: sync_all_accounts_path,
method: :post,
variant: "outline",
disabled: Current.family.syncing?,
icon: "refresh-cw",
class: ""
) %>
<% if Rails.env.development? %>
<%= render ButtonComponent.new(
text: "Sync all",
href: sync_all_accounts_path,
method: :post,
variant: "outline",
disabled: Current.family.syncing?,
icon: "refresh-cw",
) %>
<% end %>
<%= render LinkComponent.new(
text: "New account",

View file

@ -20,26 +20,15 @@
<% end %>
<div class="flex items-center gap-1 ml-auto">
<% if account.plaid_account_id.present? %>
<% if Rails.env.development? %>
<%= icon(
<% if Rails.env.development? %>
<%= icon(
"refresh-cw",
as_button: true,
size: "sm",
href: sync_plaid_item_path(account.plaid_account.plaid_item),
href: account.linked? ? sync_plaid_item_path(account.plaid_account.plaid_item) : sync_account_path(account),
disabled: account.syncing?,
frame: :_top
) %>
<% end %>
<% else %>
<%= icon(
"refresh-cw",
as_button: true,
size: "sm",
href: sync_account_path(account),
disabled: account.syncing?,
frame: :_top
) %>
<% end %>
<%= render "accounts/show/menu", account: account %>

View file

@ -92,7 +92,7 @@
</div>
</div>
<% end %>
<% else %>
<% elsif Rails.env.development? %>
<%= icon(
"refresh-cw",
as_button: true,

View file

@ -20,10 +20,6 @@ class FamilyTest < ActiveSupport::TestCase
.with(start_date: nil, parent_sync: family_sync)
.times(manual_accounts_count)
PlaidItem.any_instance.expects(:sync_later)
.with(start_date: nil, parent_sync: family_sync)
.times(items_count)
@syncable.sync_data(family_sync, start_date: family_sync.start_date)
end
end