From 945bf9c254b5bfb56df874c1a3f7f0f1e89dc8b8 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 2 May 2009 15:16:12 -0700 Subject: Check for sibling Active Support first --- activerecord/lib/active_record.rb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record.rb b/activerecord/lib/active_record.rb index 500a90d6cb..1982ffc791 100644 --- a/activerecord/lib/active_record.rb +++ b/activerecord/lib/active_record.rb @@ -21,15 +21,10 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #++ -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 +"#{File.dirname(__FILE__)}/../../activesupport/lib".tap do |path| + $:.unshift(path) if File.directory?(path) end +require 'active_support' require 'active_support/core/all' module ActiveRecord -- cgit v1.2.3 From d3ee8756c8b09b8524a9599926b02ededd27319c Mon Sep 17 00:00:00 2001 From: Chris Kampmeier Date: Sun, 3 May 2009 18:09:06 -0700 Subject: Don't use #tap before Active Support is available, since older versions of ruby don't have native implementations [#2603 state:committed] Signed-off-by: Jeremy Kemper --- activerecord/lib/active_record.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record.rb b/activerecord/lib/active_record.rb index 1982ffc791..06d6c87090 100644 --- a/activerecord/lib/active_record.rb +++ b/activerecord/lib/active_record.rb @@ -21,9 +21,8 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #++ -"#{File.dirname(__FILE__)}/../../activesupport/lib".tap do |path| - $:.unshift(path) if File.directory?(path) -end +activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib" +$:.unshift(activesupport_path) if File.directory?(activesupport_path) require 'active_support' require 'active_support/core/all' -- cgit v1.2.3