1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 05:09:38 +02:00

Allow offline trade tickers (#1925)

This commit is contained in:
Zach Gollwitzer 2025-02-28 09:34:14 -05:00 committed by GitHub
parent 882857fcf0
commit 9138bd2b76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 6 deletions

View file

@ -1,5 +1,6 @@
class Security < ApplicationRecord
include Providable
before_save :upcase_ticker
has_many :trades, dependent: :nullify, class_name: "Account::Trade"
@ -9,6 +10,10 @@ class Security < ApplicationRecord
validates :ticker, uniqueness: { scope: :exchange_operating_mic, case_sensitive: false }
class << self
def provider
security_prices_provider
end
def search(query)
security_prices_provider.search_securities(
query: query[:search],