handle settling records for homie

This commit is contained in:
Bilal
2020-09-17 15:00:55 +03:00
parent 0e5682a9a0
commit f459052fcb
4 changed files with 38 additions and 0 deletions

View File

@@ -13,6 +13,16 @@ class MoneyMove < ApplicationRecord
end
end
def self.create_settle_record(homie_id, amount)
new_desc = "Settled on #{DateTime.now.utc}"
settle_record = MoneyMove.new(
homie_id: homie_id,
amount: amount,
description: new_desc
)
settle_record.save
end
class << self
private