mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-04 21:15:19 +02:00
Test fixes
This commit is contained in:
parent
018310d4d1
commit
2e09d1a8c0
10 changed files with 126 additions and 25 deletions
|
@ -40,7 +40,7 @@ module AccountableResource
|
|||
@account.lock_saved_attributes!
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to account_params[:return_to].presence || @account, notice: accountable_type.name.underscore.humanize + " account created" }
|
||||
format.html { redirect_to account_params[:return_to].presence || account_path(@account), notice: accountable_type.name.underscore.humanize + " account created" }
|
||||
format.turbo_stream { stream_redirect_to account_params[:return_to].presence || account_path(@account), notice: accountable_type.name.underscore.humanize + " account created" }
|
||||
end
|
||||
end
|
||||
|
@ -67,8 +67,8 @@ module AccountableResource
|
|||
@account.lock_saved_attributes!
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_back_or_to @account, notice: accountable_type.name.underscore.humanize + " account updated" }
|
||||
format.turbo_stream { stream_redirect_to @account, notice: accountable_type.name.underscore.humanize + " account updated" }
|
||||
format.html { redirect_back_or_to account_path(@account), notice: accountable_type.name.underscore.humanize + " account updated" }
|
||||
format.turbo_stream { stream_redirect_to account_path(@account), notice: accountable_type.name.underscore.humanize + " account updated" }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -20,7 +20,10 @@ class AccountImport < Import
|
|||
currency: row.currency,
|
||||
date: Date.current,
|
||||
name: "Imported account value",
|
||||
entryable: Valuation.new
|
||||
entryable: Valuation.new(
|
||||
balance: row.amount.to_d,
|
||||
cash_balance: row.amount.to_d
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,17 +14,17 @@
|
|||
<%= form.text_field :name, placeholder: t(".name_placeholder"), required: "required", label: t(".name_label") %>
|
||||
|
||||
<% unless account.linked? %>
|
||||
<%= form.money_field :balance,
|
||||
label: t(".balance"),
|
||||
required: true,
|
||||
<%= form.money_field :balance,
|
||||
label: t(".balance"),
|
||||
required: true,
|
||||
default_currency: Current.family.currency,
|
||||
label_tooltip: "The current balance or value of the account, which is typically the balance reported by your financial institution." %>
|
||||
|
||||
<% unless account.persisted? %>
|
||||
<%= form.date_field :tracking_start_date,
|
||||
label: "Tracking start date",
|
||||
required: true,
|
||||
value: 2.years.ago.to_date,
|
||||
<%= form.date_field :tracking_start_date,
|
||||
label: "Tracking start date",
|
||||
required: true,
|
||||
value: 2.years.ago.to_date,
|
||||
label_tooltip: "The date we will start tracking the balance for this account. If you're not sure, we recommend using the default of 2 years ago so net worth graphs have adequate historical data." %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue