mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 23:59:40 +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
|
@ -1,3 +1,23 @@
|
|||
class Valuation < ApplicationRecord
|
||||
include Entryable
|
||||
|
||||
class << self
|
||||
def build_reconciliation_name(accountable_type)
|
||||
Valuation::Name.new("reconciliation", accountable_type).to_s
|
||||
end
|
||||
|
||||
def build_opening_anchor_name(accountable_type)
|
||||
Valuation::Name.new("opening_anchor", accountable_type).to_s
|
||||
end
|
||||
|
||||
def build_current_anchor_name(accountable_type)
|
||||
Valuation::Name.new("current_anchor", accountable_type).to_s
|
||||
end
|
||||
end
|
||||
|
||||
# TODO: Remove this method when `kind` column is added to valuations table
|
||||
# This is a temporary implementation until the database migration is complete
|
||||
def kind
|
||||
"reconciliation"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue