mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
Add instituion details & notes to Account model (#481)
- Add institution name & domain, to allow fetching logos when no provider is configured - Add free-form textarea for storing misc. notes (eg. sort codes, account numbers) - Update account settings form to support these new fields
This commit is contained in:
committed by
GitHub
parent
104324a82b
commit
68864b1fdb
@@ -0,0 +1,12 @@
|
||||
class AddInstitutionFieldsToAccounts < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
add_column :accounts, :institution_name, :string
|
||||
add_column :accounts, :institution_domain, :string
|
||||
add_column :accounts, :notes, :text
|
||||
|
||||
# Touch all accounts to invalidate cached queries that depend on accounts.maximum(:updated_at)
|
||||
# Without this, the following error would occur post-update and prevent page loads:
|
||||
# "undefined method 'institution_domain' for an instance of BalanceSheet::AccountTotals::AccountRow"
|
||||
Account.in_batches.update_all(updated_at: Time.current)
|
||||
end
|
||||
end
|
||||
3
db/schema.rb
generated
3
db/schema.rb
generated
@@ -46,6 +46,9 @@ ActiveRecord::Schema[7.2].define(version: 2025_12_15_100443) do
|
||||
t.jsonb "locked_attributes", default: {}
|
||||
t.string "status", default: "active"
|
||||
t.uuid "simplefin_account_id"
|
||||
t.string "institution_name"
|
||||
t.string "institution_domain"
|
||||
t.text "notes"
|
||||
t.index ["accountable_id", "accountable_type"], name: "index_accounts_on_accountable_id_and_accountable_type"
|
||||
t.index ["accountable_type"], name: "index_accounts_on_accountable_type"
|
||||
t.index ["currency"], name: "index_accounts_on_currency"
|
||||
|
||||
Reference in New Issue
Block a user