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:
parent
f0f4dffd3b
commit
6ebb061b18
1 changed files with 1 additions and 7 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue