aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-08-25 21:22:34 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2008-08-25 21:22:34 -0700
commit172606e21f54fea39af68ede5f55a43deaf3ac68 (patch)
tree19c336e1ebc76a53a4d15b2573d7cce6fbad74c8 /activerecord/lib/active_record.rb
parentb7a37b742c0abd1df8ea48cc82f76385cc0c41ea (diff)
downloadrails-172606e21f54fea39af68ede5f55a43deaf3ac68.tar.gz
rails-172606e21f54fea39af68ede5f55a43deaf3ac68.tar.bz2
rails-172606e21f54fea39af68ede5f55a43deaf3ac68.zip
Harmonize framework require strategy. Don't add self to load path since Rails initializer and RubyGems handle it.
Diffstat (limited to 'activerecord/lib/active_record.rb')
-rw-r--r--activerecord/lib/active_record.rb17
1 files changed, 7 insertions, 10 deletions
diff --git a/activerecord/lib/active_record.rb b/activerecord/lib/active_record.rb
index 7612015ca5..e9767c2d5e 100644
--- a/activerecord/lib/active_record.rb
+++ b/activerecord/lib/active_record.rb
@@ -21,17 +21,14 @@
# 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__)))
-
-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'
+begin
require 'active_support'
+rescue LoadError
+ activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib"
+ if File.directory?(activesupport_path)
+ $:.unshift activesupport_path
+ require 'active_support'
+ end
end
require 'active_record/base'