Add BankAccount to SupplierCategory

This commit is contained in:
Patrick Gansterer 2021-03-05 11:43:03 +01:00
parent 06b035f2ea
commit 7e60ce6ce2
3 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,6 @@
class SupplierCategory < ActiveRecord::Base
belongs_to :financial_transaction_class
belongs_to :bank_account, optional: true
has_many :suppliers
normalize_attributes :name, :description

View File

@ -0,0 +1,5 @@
class AddBankAccountToSupplierCategory < ActiveRecord::Migration[4.2]
def change
add_reference :supplier_categories, :bank_account
end
end

View File

@ -475,6 +475,7 @@ ActiveRecord::Schema.define(version: 2021_02_05_090257) do
t.string "name", null: false
t.string "description"
t.integer "financial_transaction_class_id"
t.integer "bank_account_id"
end
create_table "suppliers", id: :integer, force: :cascade do |t|