diff --git a/app/models/account.rb b/app/models/account.rb index 2b3eba50..bfc8dac1 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -1,4 +1,5 @@ class Account < ApplicationRecord + broadcasts_refreshes belongs_to :family has_many :balances, class_name: "AccountBalance" has_many :valuations diff --git a/app/views/accounts/_sync_message.html.erb b/app/views/accounts/_sync_message.html.erb index 269c9518..fe0bf405 100644 --- a/app/views/accounts/_sync_message.html.erb +++ b/app/views/accounts/_sync_message.html.erb @@ -2,7 +2,7 @@ <% if is_syncing %>

- Syncing your account balances. Please reload the page to see updated data. + Syncing your account balances.

<% end %> diff --git a/app/views/accounts/show.html.erb b/app/views/accounts/show.html.erb index 76ba4f56..069e77a2 100644 --- a/app/views/accounts/show.html.erb +++ b/app/views/accounts/show.html.erb @@ -1,3 +1,4 @@ +<%= turbo_stream_from @account %> <% balance_trend_styles = @balance_series.nil? ? {} : trend_styles(@balance_series[:trend]) %>
diff --git a/app/views/valuations/create.turbo_stream.erb b/app/views/valuations/create.turbo_stream.erb index 03a83652..c6972c53 100644 --- a/app/views/valuations/create.turbo_stream.erb +++ b/app/views/valuations/create.turbo_stream.erb @@ -1,4 +1,4 @@ -<%= turbo_stream.update Valuation.new, "" %> +<%= turbo_stream.replace Valuation.new, body: turbo_frame_tag(dom_id(Valuation.new)) %> <%= turbo_stream.append "notification-tray", partial: "shared/notification", locals: { type: "success", content: "Valuation created" } %> <%= turbo_stream.replace "valuations_list", partial: "accounts/account_valuation_list", locals: { valuation_series: @account.valuation_series } %> <%= turbo_stream.replace "sync_message", partial: "accounts/sync_message", locals: { is_syncing: true } %> diff --git a/config/cable.yml b/config/cable.yml index 536f3007..0250b01b 100644 --- a/config/cable.yml +++ b/config/cable.yml @@ -1,6 +1,5 @@ development: - adapter: redis - url: redis://localhost:6379/1 + adapter: postgresql test: adapter: test