Add model for BankGateway
This commit is contained in:
parent
7e60ce6ce2
commit
87fe9ccdb1
6 changed files with 45 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
class BankAccount < ApplicationRecord
|
||||
has_many :bank_transactions, dependent: :destroy
|
||||
belongs_to :bank_gateway, optional: true
|
||||
|
||||
normalize_attributes :name, :iban, :description
|
||||
|
||||
|
|
|
|||
8
app/models/bank_gateway.rb
Normal file
8
app/models/bank_gateway.rb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
class BankGateway < ApplicationRecord
|
||||
has_many :bank_accounts, dependent: :nullify
|
||||
belongs_to :unattended_user, class_name: 'User', optional: true
|
||||
|
||||
scope :with_unattended_support, -> { where.not(unattended_user: nil) }
|
||||
|
||||
validates_presence_of :name, :url
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue