1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Ruby 1.9.2: use recursive flatten

This commit is contained in:
Jeremy Kemper 2009-11-14 01:50:47 -08:00
parent f0f4dffd3b
commit 6ebb061b18

View file

@ -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