Files
sure/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

15 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