mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 15:49:39 +02:00
Remove dependency on stock exchange table (#1368)
This commit is contained in:
parent
b75b41a5e2
commit
45935db5f3
6 changed files with 37 additions and 22 deletions
|
@ -3,7 +3,8 @@ class Security < ApplicationRecord
|
|||
|
||||
has_many :trades, dependent: :nullify, class_name: "Account::Trade"
|
||||
|
||||
validates :ticker, presence: true, uniqueness: { case_sensitive: false }
|
||||
validates :ticker, presence: true
|
||||
validates :ticker, uniqueness: { scope: :exchange_mic, case_sensitive: false }
|
||||
|
||||
def current_price
|
||||
@current_price ||= Security::Price.find_price(ticker:, date: Date.current)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue