mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 23:59:40 +02:00
Add validation to security price model
This commit is contained in:
parent
cd91e66618
commit
c9917674aa
3 changed files with 5 additions and 3 deletions
|
@ -3,6 +3,8 @@ class Security::Price < ApplicationRecord
|
|||
|
||||
belongs_to :security
|
||||
|
||||
validates :price, :currency, presence: true
|
||||
|
||||
class << self
|
||||
def find_price(security:, date:, cache: true)
|
||||
result = find_by(security:, date:)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue