Always require activesupport, even if its constant already exists

This is needed because the existance of the ActiveSupport
constant by itself does not guarantee that the whole library
has been loaded.

Also load the StringInquirer in the Rails#env method as
the it might be called inside the initializer block
before activesupport itself has been loaded.
This commit is contained in:
Tarmo Tänav 2008-08-23 18:05:52 +03:00
parent b5c4c7daf8
commit cf28109158
2 changed files with 9 additions and 10 deletions

View File

@ -24,16 +24,14 @@
$:.unshift(File.dirname(__FILE__)) unless
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
unless defined? ActiveSupport
active_support_path = File.dirname(__FILE__) + "/../../activesupport/lib"
if File.exist?(active_support_path)
$:.unshift active_support_path
require 'active_support'
else
require 'rubygems'
gem 'activesupport'
require 'active_support'
end
active_support_path = File.dirname(__FILE__) + "/../../activesupport/lib"
if File.exist?(active_support_path)
$:.unshift active_support_path
require 'active_support'
else
require 'rubygems'
gem 'activesupport'
require 'active_support'
end
require 'active_record/base'

View File

@ -49,6 +49,7 @@ module Rails
end
def env
require 'active_support/string_inquirer'
ActiveSupport::StringInquirer.new(RAILS_ENV)
end