Initial commit
This commit is contained in:
24
app/models/currency_wallet.rb
Normal file
24
app/models/currency_wallet.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CurrencyWallet < ApplicationRecord
|
||||
self.table_name = 'currencies_wallets'
|
||||
|
||||
belongs_to :currency
|
||||
belongs_to :wallet
|
||||
validates :currency_id, uniqueness: { scope: :wallet_id }
|
||||
end
|
||||
|
||||
# == Schema Information
|
||||
# Schema version: 20201125134745
|
||||
#
|
||||
# Table name: currencies_wallets
|
||||
#
|
||||
# currency_id :string(255)
|
||||
# wallet_id :integer
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_currencies_wallets_on_currency_id (currency_id)
|
||||
# index_currencies_wallets_on_currency_id_and_wallet_id (currency_id,wallet_id) UNIQUE
|
||||
# index_currencies_wallets_on_wallet_id (wallet_id)
|
||||
#
|
||||
Reference in New Issue
Block a user