Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Only attempt to require Active Support if it hasnt been already #1959

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2247 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 5dbf5ded5c5978b8ee87044c34c3e6ca6fc381a1 1 parent e9504bb
@dhh dhh authored
View
17 actionpack/lib/action_controller.rb
@@ -21,14 +21,17 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++
-$:.unshift(File.dirname(__FILE__))
-$:.unshift(File.dirname(__FILE__) + "/../../activesupport/lib")
+$:.unshift(File.dirname(__FILE__)) unless
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
-begin
- require 'active_support'
-rescue LoadError
- require 'rubygems'
- require_gem 'activesupport'
+unless defined?(ActiveSupport)
+ begin
+ $:.unshift(File.dirname(__FILE__) + "/../../activesupport/lib")
+ require 'active_support'
+ rescue LoadError
+ require 'rubygems'
+ require_gem 'activesupport'
+ end
end
require 'action_controller/base'
View
18 activerecord/lib/active_record.rb
@@ -21,15 +21,17 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++
+$:.unshift(File.dirname(__FILE__)) unless
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
-$:.unshift(File.dirname(__FILE__))
-$:.unshift(File.dirname(__FILE__) + "/../../activesupport/lib")
-
-begin
- require 'active_support'
-rescue LoadError
- require 'rubygems'
- require_gem 'activesupport'
+unless defined?(ActiveSupport)
+ begin
+ $:.unshift(File.dirname(__FILE__) + "/../../activesupport/lib")
+ require 'active_support'
+ rescue LoadError
+ require 'rubygems'
+ require_gem 'activesupport'
+ end
end
require 'active_record/base'
Please sign in to comment.
Something went wrong with that request. Please try again.