The personal finance app for everyone
Fix security search
Zach Gollwitzer29f445d75eee
diff --git a/app/models/security.rb b/app/models/security.rbindex 72a09705..30abbe85 100644--- a/app/models/security.rb+++ b/app/models/security.rb@@ -20,9 +20,7 @@ class Security < ApplicationRecordsymbol: ticker,name: name,logo_url: logo_url,- exchange_acronym: exchange_acronym,exchange_operating_mic: exchange_operating_mic,- exchange_country_code: country_code)enddiff --git a/app/models/security/provided.rb b/app/models/security/provided.rbindex 73d0435d..3450a6e3 100644--- a/app/models/security/provided.rb+++ b/app/models/security/provided.rb@@ -13,7 +13,15 @@ module Security::Providedresponse = provider.search_securities(symbol, country_code: country_code, exchange_operating_mic: exchange_operating_mic)if response.success?- response.data+ response.data.map do |provider_security|+ # Need to map to domain model so Combobox can display via to_combobox_option+ Security.new(+ ticker: provider_security.symbol,+ name: provider_security.name,+ logo_url: provider_security.logo_url,+ exchange_operating_mic: provider_security.exchange_operating_mic,+ )+ endelse[]enddiff --git a/app/models/security/synth_combobox_option.rb b/app/models/security/synth_combobox_option.rbindex 45091690..2a9ba46a 100644--- a/app/models/security/synth_combobox_option.rb+++ b/app/models/security/synth_combobox_option.rb@@ -1,7 +1,7 @@class Security::SynthComboboxOptioninclude ActiveModel::Model- attr_accessor :symbol, :name, :logo_url, :exchange_acronym, :exchange_country_code, :exchange_operating_mic+ attr_accessor :symbol, :name, :logo_url, :exchange_operating_micdef id"#{symbol}|#{exchange_operating_mic}" # submitted by combobox as value