mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-08 23:15:24 +02:00
Tweak sync states
This commit is contained in:
parent
153bffcaf2
commit
b041edb648
6 changed files with 13 additions and 8 deletions
|
@ -31,8 +31,4 @@ class SessionsController < ApplicationController
|
||||||
def set_session
|
def set_session
|
||||||
@session = Current.user.sessions.find(params[:id])
|
@session = Current.user.sessions.find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
def session_params
|
|
||||||
params.require(:session).permit(:tab_key, :tab_value)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class SyncMarketDataJob < ApplicationJob
|
class SyncMarketDataJob < ApplicationJob
|
||||||
queue_as :scheduled
|
queue_as :scheduled
|
||||||
|
|
||||||
def perform(*args)
|
def perform
|
||||||
MarketDataSyncer.new.sync_all
|
MarketDataSyncer.new.sync_all
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,7 +12,8 @@ class Account::Syncer
|
||||||
|
|
||||||
def perform_post_sync
|
def perform_post_sync
|
||||||
account.family.auto_match_transfers!
|
account.family.auto_match_transfers!
|
||||||
account.family.broadcast_refresh
|
account.broadcast_refresh
|
||||||
|
account.family.broadcast_sidebar_refresh
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -44,6 +44,14 @@ class Family < ApplicationRecord
|
||||||
.exists?
|
.exists?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def broadcast_sidebar_refresh
|
||||||
|
broadcast_replace(
|
||||||
|
target: "account-sidebar-tabs",
|
||||||
|
partial: "accounts/sidebar_tabs",
|
||||||
|
locals: { family: self, active_account_group_tab: "all" }
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
def assigned_merchants
|
def assigned_merchants
|
||||||
merchant_ids = transactions.where.not(merchant_id: nil).pluck(:merchant_id).uniq
|
merchant_ids = transactions.where.not(merchant_id: nil).pluck(:merchant_id).uniq
|
||||||
Merchant.where(id: merchant_ids)
|
Merchant.where(id: merchant_ids)
|
||||||
|
|
|
@ -24,7 +24,7 @@ class PlaidItem::Syncer
|
||||||
|
|
||||||
def perform_post_sync
|
def perform_post_sync
|
||||||
plaid_item.auto_match_categories!
|
plaid_item.auto_match_categories!
|
||||||
plaid_item.family.broadcast_refresh
|
plaid_item.family.broadcast_sidebar_refresh
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<%# locals: (family:, active_account_group_tab: "assets") %>
|
<%# locals: (family:, active_account_group_tab: "asset") %>
|
||||||
|
|
||||||
<div id="account-sidebar-tabs">
|
<div id="account-sidebar-tabs">
|
||||||
<% if family.missing_data_provider? %>
|
<% if family.missing_data_provider? %>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue