diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-07 05:25:36 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-07 05:25:36 +0000 |
commit | a76fa613d3b5c13ed592c85e64a26e70f0020ddc (patch) | |
tree | 8b85ea1f222f1ac9d1150d75d54a43b5bfbde00f | |
parent | cd64471bdbac70e2505cca9acb622332ebd3a5f9 (diff) | |
download | rails-a76fa613d3b5c13ed592c85e64a26e70f0020ddc.tar.gz rails-a76fa613d3b5c13ed592c85e64a26e70f0020ddc.tar.bz2 rails-a76fa613d3b5c13ed592c85e64a26e70f0020ddc.zip |
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
-rwxr-xr-x | activerecord/lib/active_record.rb | 12 |
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 |