1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-08 23:15:24 +02:00

Fix account ID namespace conflict

This commit is contained in:
Zach Gollwitzer 2025-05-15 08:40:59 -04:00
parent dd5292555a
commit 37d32e47a4
3 changed files with 2 additions and 9 deletions

View file

@ -10,7 +10,7 @@ module Syncable
end end
def sync_later(parent_sync: nil, window_start_date: nil, window_end_date: nil) def sync_later(parent_sync: nil, window_start_date: nil, window_end_date: nil)
new_sync = syncs.create_with_defaults!(parent: parent_sync) new_sync = syncs.create!(parent: parent_sync, window_start_date: window_start_date, window_end_date: window_end_date)
SyncJob.perform_later(new_sync) SyncJob.perform_later(new_sync)
end end

View file

@ -35,13 +35,6 @@ class Sync < ApplicationRecord
end end
end end
class << self
# By default, we sync the "visible" window of data (user sees 30 day graphs by default)
def create_with_defaults!(parent: nil)
create!(parent: parent, window_start_date: 30.days.ago.to_date)
end
end
def perform def perform
Rails.logger.tagged("Sync", id, syncable_type, syncable_id) do Rails.logger.tagged("Sync", id, syncable_type, syncable_id) do
start! start!

View file

@ -2,7 +2,7 @@
<%= turbo_stream_from account %> <%= turbo_stream_from account %>
<%= turbo_frame_tag dom_id(account) do %> <%= turbo_frame_tag dom_id(account, :container) do %>
<%= tag.div class: "space-y-4 pb-32" do %> <%= tag.div class: "space-y-4 pb-32" do %>
<% if header.present? %> <% if header.present? %>
<%= header %> <%= header %>