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:
parent
7f2988b7f0
commit
ecfb178b87
2 changed files with 2 additions and 2 deletions
|
@ -33,7 +33,7 @@ class AccountsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def account_type_class
|
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
|
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
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class Account < ApplicationRecord
|
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
|
belongs_to :family
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue