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

Fix holding name error (#1113)

* Add optional debugger to bin/dev script

* Fix holding naming
This commit is contained in:
Zach Gollwitzer 2024-08-20 17:35:23 -04:00 committed by GitHub
parent 37ae51f68a
commit 4433488562
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 4 deletions

View file

@ -14,9 +14,12 @@ class Account::Holding < ApplicationRecord
scope :known_value, -> { where.not(amount: nil) }
scope :for, ->(security) { where(security_id: security).order(:date) }
delegate :name, to: :security
delegate :ticker, to: :security
def name
security.name || ticker
end
def weight
return nil unless amount