Add model for BankGateway

This commit is contained in:
Patrick Gansterer 2021-03-05 12:43:40 +01:00
parent 7e60ce6ce2
commit 87fe9ccdb1
6 changed files with 45 additions and 0 deletions

View file

@ -1,5 +1,6 @@
class BankAccount < ApplicationRecord
has_many :bank_transactions, dependent: :destroy
belongs_to :bank_gateway, optional: true
normalize_attributes :name, :iban, :description

View 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