1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 13:19:39 +02:00
Maybe/app/models/account.rb
Nidhi Sarvaiya 1182ab39bd
Integrate money-rails gem (#268)
* Integrate money-rails gem

* Fix Lint issues

* Basic test for monetize feature

* Merge main branch

* Changes to monetize balance field

---------

Co-authored-by: Zach Gollwitzer <zach.gollwitzer@gmail.com>
2024-02-06 12:30:51 -05:00

9 lines
341 B
Ruby

class Account < ApplicationRecord
belongs_to :family
delegated_type :accountable, types: %w[ Account::Credit Account::Depository Account::Investment Account::Loan Account::OtherAsset Account::OtherLiability Account::Property Account::Vehicle], dependent: :destroy
delegate :type_name, to: :accountable
monetize :balance_cents
end