Permalink
Browse files

Ruby 1.9.2: use recursive flatten

  • Loading branch information...
1 parent f0f4dff commit 6ebb061b18cd5af087453879b3eac0f719ea4ec4 @jeremy jeremy committed Nov 14, 2009
Showing with 1 addition and 7 deletions.
  1. +1 −7 activerecord/lib/active_record/associations/association_proxy.rb
@@ -264,13 +264,7 @@ def flatten_deeper(array)
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

0 comments on commit 6ebb061

Please sign in to comment.