Skip to content

armgit / maybe

Public Imported from GitHub
0

The personal finance app for everyone

Only pass in a country code on securities searches if the user location is set to "US"

Josh Pigford44961f36281d
diff --git a/app/controllers/securities_controller.rb b/app/controllers/securities_controller.rb
index 4a3c65c4..5be3cbd9 100644
--- a/app/controllers/securities_controller.rb
+++ b/app/controllers/securities_controller.rb
@@ -5,14 +5,7 @@ class SecuritiesController < ApplicationController
@securities = Security.search({
search: query,
- country: country_code_filter
+ country: params[:country_code] == "US" ? "US" : nil
})
end
-
- private
- def country_code_filter
- filter = params[:country_code]
- filter = "#{filter},US" unless filter == "US"
- filter
- end
end