mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 13:19:39 +02:00
* User tickers as primary lookup symbol instead of isin * Add security price provider * Fetch security prices in bulk to improve sync performance * Fetch prices in bulk, better mocking for tests
13 lines
291 B
Ruby
13 lines
291 B
Ruby
class Security < ApplicationRecord
|
|
before_save :upcase_ticker
|
|
|
|
has_many :trades, dependent: :nullify, class_name: "Account::Trade"
|
|
|
|
validates :ticker, presence: true, uniqueness: { case_sensitive: false }
|
|
|
|
private
|
|
|
|
def upcase_ticker
|
|
self.ticker = ticker.upcase
|
|
end
|
|
end
|