aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-11-14 01:50:47 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2009-11-14 01:50:47 -0800
commit6ebb061b18cd5af087453879b3eac0f719ea4ec4 (patch)
tree4d7b3e63034efc632dc3f274498c0eae3717a302 /activerecord/lib/active_record/associations
parentf0f4dffd3b469c0f4ba743c960110e8663955436 (diff)
downloadrails-6ebb061b18cd5af087453879b3eac0f719ea4ec4.tar.gz
rails-6ebb061b18cd5af087453879b3eac0f719ea4ec4.tar.bz2
rails-6ebb061b18cd5af087453879b3eac0f719ea4ec4.zip
Ruby 1.9.2: use recursive flatten
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r--activerecord/lib/active_record/associations/association_proxy.rb8
1 files changed, 1 insertions, 7 deletions
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