From 141f7c5ad336d39f606356fc0e8748c7d0a6602a Mon Sep 17 00:00:00 2001 From: Jakub Date: Thu, 16 Jul 2009 18:32:15 +0200 Subject: [PATCH] removed safe_to_array method, using standard library's Kernel#Array method instead --- activerecord/lib/active_record/base.rb | 16 ++-------------- 1 files changed, 2 insertions(+), 14 deletions(-) diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index deab56e..9bc8131 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1730,7 +1730,7 @@ module ActiveRecord #:nodoc: # Merges includes so that the result is a valid +include+ def merge_includes(first, second) - (safe_to_array(first) + safe_to_array(second)).uniq + (Array(first) + Array(second)).uniq end def merge_joins(*joins) @@ -1745,19 +1745,7 @@ module ActiveRecord #:nodoc: end joins.flatten.map{|j| j.strip}.uniq else - joins.collect{|j| safe_to_array(j)}.flatten.uniq - end - end - - # Object#to_a is deprecated, though it does have the desired behavior - def safe_to_array(o) - case o - when NilClass - [] - when Array - o - else - [o] + joins.collect{|j| Array(j)}.flatten.uniq end end -- 1.6.0.4