Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/pinpoint_supported_countries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def sms_support

CountrySupport.new(
iso_code: iso_code,
name: trim_spaces(sms_config['Country or region']),
name: trim_spaces_digits(sms_config['Country or region']),
supports_sms: supports_sms,
)
end
Expand Down Expand Up @@ -159,6 +159,10 @@ def trim_spaces(str)
str.gsub(/\s{2,}/, ' ').gsub(/\s+$/, '')
end

def trim_spaces_digits(str)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment explaining why this is here?

Suggested change
def trim_spaces_digits(str)
# Remove trailing footnote numbers from country names
def trim_spaces_digits(str)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have a bunch of trimming code and other footnotes in other columns (and in the specs) so I think it'll be ok without

trim_spaces(str).gsub(/\d+$/, '')
end

def digits_only?(str)
str.to_i.to_s == str
end
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/pinpoint_supported_countries_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</td>
</tr>
<tr>
<td>Argentina</td>
<td>Argentina<sup><a href="#sms-support-note-1">2</a></sup></td>
<td>AR</td>
<td></td>
<td>Yes</td>
Expand Down