mirror of
https://github.com/we-promise/sure.git
synced 2026-04-18 19:44:09 +00:00
Remove duplication
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user