1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 13:19:39 +02:00

Add initial list of valid account types

This commit is contained in:
Rob Zolkos 2024-02-02 17:01:47 +00:00
parent 9aa9f99810
commit f1909b3bf2
2 changed files with 3 additions and 3 deletions

View file

@ -33,9 +33,7 @@ class AccountsController < ApplicationController
end end
def account_type_class def account_type_class
valid_account_types = %w[Checking CreditCard] if params[:type].present? && Account::VALID_ACCOUNT_TYPES.include?(params[:type])
if params[:type].present? && valid_account_types.include?(params[:type])
params[:type].constantizes params[:type].constantizes
else else
Account # Default to Account if type is not provided or invalid Account # Default to Account if type is not provided or invalid

View file

@ -1,3 +1,5 @@
class Account < ApplicationRecord class Account < ApplicationRecord
belongs_to :family belongs_to :family
VALID_ACCOUNT_TYPES = %w[Investment Depository Credit Loan Property Vehicle OtherAsset OtherLiability].freeze
end end