aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-05-26 06:20:07 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-05-26 06:20:07 +0000
commit652fe645f6a199417f672965b1f4d4078d046f7d (patch)
treea8ab52f73cea5aff75b85abfc67b80f00d3c5f59 /activesupport/lib
parent40860e9852d08837197b5a96a48b4439cbc86852 (diff)
downloadrails-652fe645f6a199417f672965b1f4d4078d046f7d.tar.gz
rails-652fe645f6a199417f672965b1f4d4078d046f7d.tar.bz2
rails-652fe645f6a199417f672965b1f4d4078d046f7d.zip
Array#to_xml yields the builder just like Hash and ActiveRecord::Base. Closes #8472.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6858 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/array/conversions.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/array/conversions.rb b/activesupport/lib/active_support/core_ext/array/conversions.rb
index 51ac83294c..a4d056e81c 100644
--- a/activesupport/lib/active_support/core_ext/array/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/array/conversions.rb
@@ -63,7 +63,10 @@ module ActiveSupport #:nodoc:
opts = options.merge({ :root => children })
- options[:builder].tag!(root) { each { |e| e.to_xml(opts.merge!({ :skip_instruct => true })) } }
+ options[:builder].tag!(root) {
+ yield options[:builder] if block_given?
+ each { |e| e.to_xml(opts.merge!({ :skip_instruct => true })) }
+ }
end
end