aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord')
-rwxr-xr-xactiverecord/lib/active_record.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/activerecord/lib/active_record.rb b/activerecord/lib/active_record.rb
index 73f5229753..36c1a2bd31 100755
--- a/activerecord/lib/active_record.rb
+++ b/activerecord/lib/active_record.rb
@@ -24,13 +24,15 @@
$:.unshift(File.dirname(__FILE__)) unless
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
-unless defined?(ActiveSupport)
- begin
- $:.unshift(File.dirname(__FILE__) + "/../../activesupport/lib")
- require 'active_support'
- rescue LoadError
+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
end