1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 05:09:38 +02:00
Maybe/app/models/valuation.rb
Zach Gollwitzer 0fe9b6d34a
Add Money and Money Series (#505)
* Add Money class

* Standardize creation of money series

* Formatting

* Fix test
2024-03-01 17:17:34 -05:00

14 lines
278 B
Ruby

class Valuation < ApplicationRecord
belongs_to :account
after_commit :sync_account
def trend(previous)
Trend.new(current: value, previous: previous&.value, type: account.classification)
end
private
def sync_account
self.account.sync_later
end
end