aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorAndrew White <pixeltrix@users.noreply.github.com>2017-11-15 11:25:53 +0000
committerGitHub <noreply@github.com>2017-11-15 11:25:53 +0000
commitebc6b171ac4b3e8c7026c18cbb115949e8f1982f (patch)
tree6494ccb2902ba386f56850e9bb264d41f365b9a6 /activesupport/lib
parent706b4bee89655bc02cc3a7ef1a6890fe7c868dec (diff)
parent2eea6458a14d99b19dffe8673015cde0800f128a (diff)
downloadrails-ebc6b171ac4b3e8c7026c18cbb115949e8f1982f.tar.gz
rails-ebc6b171ac4b3e8c7026c18cbb115949e8f1982f.tar.bz2
rails-ebc6b171ac4b3e8c7026c18cbb115949e8f1982f.zip
Merge pull request #31128 from rails/handle-ambigious-times
Handle `TZInfo::AmbiguousTime` errors
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/values/time_zone.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb
index d1a2003013..b294d99fe0 100644
--- a/activesupport/lib/active_support/values/time_zone.rb
+++ b/activesupport/lib/active_support/values/time_zone.rb
@@ -506,7 +506,7 @@ module ActiveSupport
# Available so that TimeZone instances respond like TZInfo::Timezone
# instances.
def period_for_local(time, dst = true)
- tzinfo.period_for_local(time, dst)
+ tzinfo.period_for_local(time, dst) { |periods| periods.last }
end
def periods_for_local(time) #:nodoc: