mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-10 21:24:20 +01:00
13 lines
316 B
Ruby
13 lines
316 B
Ruby
class WalletTransaction < ActiveRecord::Base
|
|
include AmountConcern
|
|
|
|
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
|
|
end
|