diff options
author | Michael Koziarski <michael@koziarski.com> | 2008-10-19 13:23:27 +0200 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-10-19 13:26:36 +0200 |
commit | 6d1d48de6a16b0ff4e4533cccf00c0ec747feefb (patch) | |
tree | d95df33dcfe2a2d16284f54b3a1d9d8451e30e1d | |
parent | 550fbcceddceabdb4fe000ee52142e8461b28d54 (diff) | |
download | rails-6d1d48de6a16b0ff4e4533cccf00c0ec747feefb.tar.gz rails-6d1d48de6a16b0ff4e4533cccf00c0ec747feefb.tar.bz2 rails-6d1d48de6a16b0ff4e4533cccf00c0ec747feefb.zip |
Memoize the require and construction of the StringInquirer
-rw-r--r-- | railties/lib/initializer.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 0aec97dece..6500b2d309 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -49,8 +49,10 @@ module Rails end def env - require 'active_support/string_inquirer' - ActiveSupport::StringInquirer.new(RAILS_ENV) + @_env ||= begin + require 'active_support/string_inquirer' + ActiveSupport::StringInquirer.new(RAILS_ENV) + end end def cache |