mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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:
parent
b5c4c7daf8
commit
cf28109158
2 changed files with 9 additions and 10 deletions
|
@ -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'
|
||||
|
|
|
@ -49,6 +49,7 @@ module Rails
|
|||
end
|
||||
|
||||
def env
|
||||
require 'active_support/string_inquirer'
|
||||
ActiveSupport::StringInquirer.new(RAILS_ENV)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue