Skip to content

Commit

Permalink
handle missing country code. #257
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed May 15, 2019
1 parent 38a198d commit 969aac9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/funder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ def self.query(query, options={})
def self.parse_message(id: nil, message: nil)
if message["location"].present?
c = ISO3166::Country.find_country_by_name(message["location"])
code = c.alpha2.present? ? c.alpha2 : nil
country = {
"code" => c.alpha2,
"code" => code,
"name" => message["location"]
}
else
Expand Down

0 comments on commit 969aac9

Please sign in to comment.