Memoize the require and construction of the StringInquirer

This commit is contained in:
Michael Koziarski
2008-10-19 13:23:27 +02:00
parent 550fbccedd
commit 6d1d48de6a

View File

@@ -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