1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-22 06:39:39 +02:00
Maybe/app/models/valuation.rb

15 lines
278 B
Ruby
Raw Normal View History

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