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

Remove duplication

This commit is contained in:
Rob Zolkos 2024-02-02 21:33:43 +00:00
parent 7f2988b7f0
commit ecfb178b87
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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