Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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.
  • Loading branch information...
commit cf28109158054fbab91de2d6d86efe1b40e68d93 1 parent b5c4c7d
@tarmo tarmo authored
Showing with 9 additions and 10 deletions.
  1. +8 −10 activerecord/lib/active_record.rb
  2. +1 −0  railties/lib/initializer.rb
View
18 activerecord/lib/active_record.rb
@@ -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
1  railties/lib/initializer.rb
@@ -49,6 +49,7 @@ def root
end
def env
+ require 'active_support/string_inquirer'
ActiveSupport::StringInquirer.new(RAILS_ENV)
end
Please sign in to comment.
Something went wrong with that request. Please try again.