mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-25 08:09:38 +02:00
Centralize entry naming (#2454)
* Centralize entry naming * Lint fixes, code style
This commit is contained in:
parent
afbfb474c2
commit
9110ab27d2
12 changed files with 187 additions and 16 deletions
|
@ -64,14 +64,14 @@ class Account < ApplicationRecord
|
|||
transaction do
|
||||
# Create 2 valuations for new accounts to establish a value history for users to see
|
||||
account.entries.build(
|
||||
name: "Current Balance",
|
||||
name: Valuation.build_current_anchor_name(account.accountable_type),
|
||||
date: Date.current,
|
||||
amount: account.balance,
|
||||
currency: account.currency,
|
||||
entryable: Valuation.new
|
||||
)
|
||||
account.entries.build(
|
||||
name: "Initial Balance",
|
||||
name: Valuation.build_opening_anchor_name(account.accountable_type),
|
||||
date: 1.day.ago.to_date,
|
||||
amount: initial_balance,
|
||||
currency: account.currency,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue