The personal finance app for everyone
Remove duplication
Rob Zolkosecfb178b87ad
diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rbindex 835edb8b..1e7634c7 100644--- a/app/controllers/accounts_controller.rb+++ b/app/controllers/accounts_controller.rb@@ -33,7 +33,7 @@ class AccountsController < ApplicationControllerenddef 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].constantizeselseAccount # Default to Account if type is not provided or invaliddiff --git a/app/models/account.rb b/app/models/account.rbindex 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].freezebelongs_to :family