Permalink
Browse files

Merge pull request #2913 from toolmantim/3-1-stable

Make sure require_tzinfo only calls Kernel#require if TZInfo isn't already present
  • Loading branch information...
2 parents 759f3e5 + d6d4740 commit 4a2e619a1a4193c698a656e7f6ca80ef1e0e4b3c @tenderlove tenderlove committed Sep 7, 2011
Showing with 3 additions and 1 deletion.
  1. +2 −0 activesupport/CHANGELOG
  2. +1 −1 activesupport/lib/active_support/values/time_zone.rb
View
@@ -1,5 +1,7 @@
*Rails 3.1.1 (unreleased)*
+* Fixed performance issue where TimeZone lookups would require tzinfo each time [Tim Lucas]
+
* ActiveSupport::OrderedHash is now marked as extractable when using Array#extract_options! [Prem Sichanugrist]
*Rails 3.1.0 (August 30, 2011)*
@@ -373,7 +373,7 @@ def us_zones
protected
def require_tzinfo
- require 'tzinfo'
+ require 'tzinfo' unless defined?(::TZInfo)
rescue LoadError
$stderr.puts "You don't have tzinfo installed in your application. Please add it to your Gemfile and run bundle install"
raise

0 comments on commit 4a2e619

Please sign in to comment.