The personal finance app for everyone
Add additional subtypes, add None option, prefill edit with previously selected option. (#1286)
Alex Hatzenbuhlerc5bf1db23012
diff --git a/app/models/investment.rb b/app/models/investment.rbindex 15ef92af..d5c583fe 100644--- a/app/models/investment.rb+++ b/app/models/investment.rb@@ -6,11 +6,13 @@ class Investment < ApplicationRecord[ "Pension", "pension" ],[ "Retirement", "retirement" ],[ "401(k)", "401k" ],- [ "529 plan", "529_plan" ],+ [ "Traditional 401(k)", "traditional_401k" ],+ [ "Roth 401(k)", "roth_401k" ],+ [ "529 Plan", "529_plan" ],[ "Health Savings Account", "hsa" ],[ "Mutual Fund", "mutual_fund" ],+ [ "Traditional IRA", "traditional_ira" ],[ "Roth IRA", "roth_ira" ],- [ "Roth 401k", "roth_401k" ],[ "Angel", "angel" ]].freezediff --git a/app/views/accounts/accountables/_depository.html.erb b/app/views/accounts/accountables/_depository.html.erbindex d524cc2d..0504400a 100644--- a/app/views/accounts/accountables/_depository.html.erb+++ b/app/views/accounts/accountables/_depository.html.erb@@ -1 +1 @@-<%= f.select :subtype, options_for_select([["Checking", "checking"], ["Savings", "savings"]], selected: ""), { label: "Type" } %>+<%= f.select :subtype, [["Checking", "checking"], ["Savings", "savings"]], { label: true, prompt: t(".prompt"), include_blank: t(".none") } %>diff --git a/app/views/accounts/accountables/_investment.html.erb b/app/views/accounts/accountables/_investment.html.erbindex d403d991..86355b07 100644--- a/app/views/accounts/accountables/_investment.html.erb+++ b/app/views/accounts/accountables/_investment.html.erb@@ -1 +1 @@-<%= f.select :subtype, options_for_select(Investment::SUBTYPES, selected: ""), { label: true } %>+<%= f.select :subtype, Investment::SUBTYPES, { label: true, prompt: t(".prompt"), include_blank: t(".none") } %>diff --git a/config/locales/views/accounts/en.yml b/config/locales/views/accounts/en.ymlindex b0b64212..cb6668ef 100644--- a/config/locales/views/accounts/en.yml+++ b/config/locales/views/accounts/en.yml@@ -5,6 +5,9 @@ en:has_issues: Issue detected.troubleshoot: Troubleshootaccountables:+ investment:+ prompt: Select a subtype+ none: Nonecredit_card:annual_fee: Annual feeannual_fee_placeholder: '99'@@ -23,6 +26,9 @@ en:expiration_date: Expiration Dateminimum_payment: Minimum Paymentunknown: Unknown+ depository:+ prompt: Select a subtype+ none: Noneloan:interest_rate: Interest rateinterest_rate_placeholder: '5.25'