1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/app/models/wallet_transaction.rb

13 lines
316 B
Ruby
Raw Normal View History

2016-07-04 19:20:10 +02:00
class WalletTransaction < ActiveRecord::Base
2016-07-05 12:30:52 +02:00
include AmountConcern
2016-07-04 19:20:10 +02:00
belongs_to :user
belongs_to :wallet
belongs_to :reservation
belongs_to :transactable, polymorphic: true
has_one :invoice
validates_inclusion_of :transaction_type, in: %w( credit debit )
validates :user, :wallet, presence: true
2016-07-04 19:20:10 +02:00
end