mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 15:49:39 +02:00
* Sketch out sync interface * Add basic account sync algorithm * Update logic for final balance in series * Remove start_date concept * Clean up tests * Improve clarity of test * Update app/models/account.rb Co-authored-by: Rob Zolkos <rob@zolkos.com> Signed-off-by: Zach Gollwitzer <zach.gollwitzer@gmail.com> * Update app/models/transaction.rb Co-authored-by: Rob Zolkos <rob@zolkos.com> Signed-off-by: Zach Gollwitzer <zach.gollwitzer@gmail.com> * Update app/models/valuation.rb Co-authored-by: Rob Zolkos <rob@zolkos.com> Signed-off-by: Zach Gollwitzer <zach.gollwitzer@gmail.com> * Re-organize code, simplify job interface * Consolidate balance calculations * More cleanup --------- Signed-off-by: Zach Gollwitzer <zach.gollwitzer@gmail.com> Co-authored-by: Rob Zolkos <rob@zolkos.com>
14 lines
229 B
Ruby
14 lines
229 B
Ruby
class Valuation < ApplicationRecord
|
|
belongs_to :account
|
|
|
|
after_commit :sync_account
|
|
|
|
def trend(previous)
|
|
Trend.new(value, previous&.value)
|
|
end
|
|
|
|
private
|
|
def sync_account
|
|
self.account.sync_later
|
|
end
|
|
end
|