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

Fix exception in AS::Timezone.all when any tzinfo data is missing #32613

Merged
merged 2 commits into from Apr 19, 2018

Commits on Apr 18, 2018

  1. Fix exception in AS::Timezone.all when any tzinfo data is missing

    Before this change missing timezone data for any of the time zones
    defined in `ActiveSupport::Timezone::MAPPING` caused a `comparison of
    NilClass with ActiveSupport::TimeZone failed` exception.
    
    Attempting to get a timezone by passing a number/duration to `[]` or
    calling `all` directly will try to sort sort the values of `zones_map`.
    Those values are initialized by the return value of `create(zonename)`
    which returns `nil` if `TZInfo` is unable to find the timezone
    information.
    
    In our case the exception was triggered by an outdated tzdata package
    which did not include information for the "recently" added time zones.
    
    Before 078421b `zones_map` only
    returned the information that have been loaded into `@lazy_zone_map`
    which ignored time zones for which the data could not be loaded, this
    change restores the previous behaviour.
    dsander committed Apr 18, 2018
    Copy the full SHA
    7d25b65 View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2018

  1. Copy the full SHA
    fb2af6f View commit details
    Browse the repository at this point in the history