Skip to content

Commit 7ae4a5f

Browse files
committed
Automatically eager load TZInfo
On the first call it can be a bit slow because it needs to load a bunch of data. It's also better to do it as part of boot so that some of that data is shared via Copy-on-Write
1 parent 79cf77d commit 7ae4a5f

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ PATH
9292
drb
9393
i18n (>= 1.6, < 2)
9494
minitest (>= 5.1)
95-
tzinfo (~> 2.0)
95+
tzinfo (~> 2.0, >= 2.0.5)
9696
rails (7.2.0.alpha)
9797
actioncable (= 7.2.0.alpha)
9898
actionmailbox (= 7.2.0.alpha)

activesupport/activesupport.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Gem::Specification.new do |s|
3535
# https://edgeguides.rubyonrails.org/security.html#dependency-management-and-cves
3636

3737
s.add_dependency "i18n", ">= 1.6", "< 2"
38-
s.add_dependency "tzinfo", "~> 2.0"
38+
s.add_dependency "tzinfo", "~> 2.0", ">= 2.0.5"
3939
s.add_dependency "concurrent-ruby", "~> 1.0", ">= 1.0.2"
4040
s.add_dependency "connection_pool", ">= 2.2.5"
4141
s.add_dependency "minitest", ">= 5.1"

activesupport/lib/active_support/railtie.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ class Railtie < Rails::Railtie # :nodoc:
9393
end
9494
require "active_support/core_ext/time/zones"
9595
Time.zone_default = Time.find_zone!(app.config.time_zone)
96+
config.eager_load_namespaces << TZInfo
9697
end
9798

9899
# Sets the default week start

0 commit comments

Comments
 (0)