mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 21:29:38 +02:00
Fix holding name error (#1113)
* Add optional debugger to bin/dev script * Fix holding naming
This commit is contained in:
parent
37ae51f68a
commit
4433488562
3 changed files with 9 additions and 4 deletions
|
@ -1,3 +1,3 @@
|
||||||
web: bin/rails server -b 0.0.0.0
|
web: ${DEBUG:+rdbg -O -n -c --} bin/rails server -b 0.0.0.0
|
||||||
css: bin/rails tailwindcss:watch
|
css: bin/rails tailwindcss:watch
|
||||||
worker: bundle exec good_job start
|
worker: bundle exec good_job start
|
||||||
|
|
|
@ -14,9 +14,12 @@ class Account::Holding < ApplicationRecord
|
||||||
scope :known_value, -> { where.not(amount: nil) }
|
scope :known_value, -> { where.not(amount: nil) }
|
||||||
scope :for, ->(security) { where(security_id: security).order(:date) }
|
scope :for, ->(security) { where(security_id: security).order(:date) }
|
||||||
|
|
||||||
delegate :name, to: :security
|
|
||||||
delegate :ticker, to: :security
|
delegate :ticker, to: :security
|
||||||
|
|
||||||
|
def name
|
||||||
|
security.name || ticker
|
||||||
|
end
|
||||||
|
|
||||||
def weight
|
def weight
|
||||||
return nil unless amount
|
return nil unless amount
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,11 @@
|
||||||
<%= turbo_frame_tag dom_id(holding) do %>
|
<%= turbo_frame_tag dom_id(holding) do %>
|
||||||
<div class="grid grid-cols-12 items-center text-gray-900 text-sm font-medium p-4">
|
<div class="grid grid-cols-12 items-center text-gray-900 text-sm font-medium p-4">
|
||||||
<div class="col-span-4 flex items-center gap-4">
|
<div class="col-span-4 flex items-center gap-4">
|
||||||
<%= render "shared/circle_logo", name: holding.name || "H" %>
|
<%= render "shared/circle_logo", name: holding.name %>
|
||||||
|
|
||||||
<div class="space-y-0.5">
|
<div class="space-y-0.5">
|
||||||
<%= link_to holding.name || holding.ticker, account_holding_path(holding.account, holding), data: { turbo_frame: :drawer }, class: "hover:underline" %>
|
<%= link_to holding.name, account_holding_path(holding.account, holding), data: { turbo_frame: :drawer }, class: "hover:underline" %>
|
||||||
|
|
||||||
<% if holding.amount %>
|
<% if holding.amount %>
|
||||||
<%= tag.p holding.ticker, class: "text-gray-500 text-xs uppercase" %>
|
<%= tag.p holding.ticker, class: "text-gray-500 text-xs uppercase" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue