From 6ebb061b18cd5af087453879b3eac0f719ea4ec4 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 14 Nov 2009 01:50:47 -0800 Subject: Ruby 1.9.2: use recursive flatten --- activerecord/lib/active_record/associations/association_proxy.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'activerecord/lib/active_record/associations') diff --git a/activerecord/lib/active_record/associations/association_proxy.rb b/activerecord/lib/active_record/associations/association_proxy.rb index 3cd1a1d922..7d8f4670fa 100644 --- a/activerecord/lib/active_record/associations/association_proxy.rb +++ b/activerecord/lib/active_record/associations/association_proxy.rb @@ -264,13 +264,7 @@ module ActiveRecord end else def flatten_deeper(array) - array.sum [] do |elem| - if elem.respond_to?(:each) - flatten_deeper(elem) - else - [elem] - end - end + array.flatten end end -- cgit v1.2.3