1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-20 21:59:38 +02:00
Maybe/app/models/valuation.rb
Zach Gollwitzer b1bfdef8ff
Isolate infinite loop bug, add timeout to actions (#583)
* Isolate infinite loop bug, add timeout to actions

* Increase timeout to allow for temporary failure

* Set correct timeout, implement temporary fix

* Trigger syncs at controller layer
2024-03-29 12:53:08 -04:00

13 lines
330 B
Ruby

class Valuation < ApplicationRecord
include Monetizable
belongs_to :account
validates :account, :date, :value, presence: true
monetize :value
scope :in_period, ->(period) { period.date_range.nil? ? all : where(date: period.date_range) }
def self.to_series
TimeSeries.from_collection all, :value_money
end
end