diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 835edb8b..1e7634c7 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -33,7 +33,7 @@ class AccountsController < ApplicationController end def account_type_class - if params[:type].present? && Account::VALID_ACCOUNT_TYPES.include?(params[:type]) + if params[:type].present? && Account.accountable_types.include?(params[:type]) params[:type].constantizes else Account # Default to Account if type is not provided or invalid diff --git a/app/models/account.rb b/app/models/account.rb index 7231dfbd..034aedb1 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -1,5 +1,5 @@ class Account < ApplicationRecord - VALID_ACCOUNT_TYPES = %w[Investment Depository Credit Loan Property Vehicle OtherAsset OtherLiability].freeze + # VALID_ACCOUNT_TYPES = %w[Investment Depository Credit Loan Property Vehicle OtherAsset OtherLiability].freeze belongs_to :family