The personal finance app for everyone (by everyone)
Ruby
fix: preserve Generic investment subtypes in account creation form (#1465)
xinmotlanthua92e1b64d03ab
diff --git a/app/models/investment.rb b/app/models/investment.rbindex 3d18a83345..2ff1bde2f4 100644--- a/app/models/investment.rb+++ b/app/models/investment.rb@@ -102,7 +102,11 @@ class Investment < ApplicationRecord# Build region order: user's region first (if known), then Generic, then othersother_regions = %w[us uk ca au eu] - [ user_region ].compact- region_order = [ user_region, nil, *other_regions ].compact.uniq+ region_order = if user_region+ [ user_region, nil, *other_regions ].uniq+ else+ [ nil, *other_regions ].uniq+ endregion_order.filter_map do |region|next unless grouped[region]