update model wallet

This commit is contained in:
wyx 2020-07-25 12:12:34 +08:00
parent d480deee64
commit 0f69255422
1 changed files with 4 additions and 0 deletions

View File

@ -1,2 +1,6 @@
class Wallet < ApplicationRecord
belongs_to :user
has_many :outcome, class_name: 'CoinChange', foreign_key: 'from_wallet_id', dependent: :destroy
has_many :income, class_name: 'CoinChange', foreign_key: 'to_wallet_id', dependent: :destroy
validates :balance, presence: true
end