From a76fa613d3b5c13ed592c85e64a26e70f0020ddc Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 7 Oct 2007 05:25:36 +0000 Subject: Check for the dir instead of relying on an exception. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7768 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'activerecord/lib') 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 -- cgit v1.2.3