Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return all mappings for a timezone id in country_zones #32052

Merged
merged 1 commit into from
Feb 19, 2018

Conversation

pixeltrix
Copy link
Contributor

Some timezones like Europe/London have multiple mappings in ActiveSupport::TimeZone::MAPPING so return all of them instead of the first one found by using Hash#value. e.g:

# Before
ActiveSupport::TimeZone.country_zones("GB") # => ["Edinburgh"]

# After
ActiveSupport::TimeZone.country_zones("GB") # => ["Edinburgh", "London"]

Fixes #31668.

Some timezones like `Europe/London` have multiple mappings in
`ActiveSupport::TimeZone::MAPPING` so return all of them instead
of the first one found by using `Hash#value`. e.g:

  # Before
  ActiveSupport::TimeZone.country_zones("GB") # => ["Edinburgh"]

  # After
  ActiveSupport::TimeZone.country_zones("GB") # => ["Edinburgh", "London"]

Fixes #31668.
@pixeltrix pixeltrix changed the title Return all mappings for a timezone id in country_zones Return all mappings for a timezone id in country_zones Feb 19, 2018
@pixeltrix pixeltrix merged commit 0d41a76 into master Feb 19, 2018
@pixeltrix pixeltrix deleted the fix-country-zones-with-multiple-mappings branch February 19, 2018 12:30
@pixeltrix
Copy link
Contributor Author

Backported to 5-2-stable, 5-1-stable and 5-0-stable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant