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:
parent
882857fcf0
commit
9138bd2b76
4 changed files with 21 additions and 6 deletions
|
@ -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],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue