Skip to content

armgit / sure

Public Imported from GitHub
0

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.rb
index 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 others
other_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
+ end
region_order.filter_map do |region|
next unless grouped[region]