From ab321268f86d9013cbd4ecd0b5f46e7b05ec55a9 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 22 Apr 2009 16:10:49 -0700 Subject: No more free lunch --- activemodel/lib/active_model/core.rb | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'activemodel/lib/active_model') diff --git a/activemodel/lib/active_model/core.rb b/activemodel/lib/active_model/core.rb index 47b968e121..6b2bee53d9 100644 --- a/activemodel/lib/active_model/core.rb +++ b/activemodel/lib/active_model/core.rb @@ -1,7 +1,12 @@ -# This file is required by each major ActiveModel component for the core requirements. This allows you to -# load individual pieces of ActiveModel as needed. -$LOAD_PATH << File.join(File.dirname(__FILE__), '..', '..', '..', 'activesupport', 'lib') +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 -# premature optimization? # So far, we only need the string inflections and not the rest of ActiveSupport. -require 'active_support/inflector' \ No newline at end of file +require 'active_support/inflector' -- cgit v1.2.3