diff options
author | mfoster <fosterinfo@gmail.com> | 2010-01-31 01:03:52 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-04-10 18:12:43 +0200 |
commit | 5850edf104ab1da0f72a43e6717a1270134db293 (patch) | |
tree | 34f6eeca7ace455e57162a2ea2dfc9dd0f0b4169 /activesupport/lib | |
parent | dc974306301809f4e184f518261f5baae2c909eb (diff) | |
download | rails-5850edf104ab1da0f72a43e6717a1270134db293.tar.gz rails-5850edf104ab1da0f72a43e6717a1270134db293.tar.bz2 rails-5850edf104ab1da0f72a43e6717a1270134db293.zip |
Made arrays of ActiveRecords, and any classes, with namespaces convert to valid xml. [#3824 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/array/conversions.rb | 2 |
1 files changed, 1 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 2119322bfe..5d8e78e6e5 100644 --- a/activesupport/lib/active_support/core_ext/array/conversions.rb +++ b/activesupport/lib/active_support/core_ext/array/conversions.rb @@ -131,7 +131,7 @@ class Array require 'builder' unless defined?(Builder) options = options.dup - options[:root] ||= all? { |e| e.is_a?(first.class) && first.class.to_s != "Hash" } ? ActiveSupport::Inflector.pluralize(ActiveSupport::Inflector.underscore(first.class.name)) : "records" + options[:root] ||= all? { |e| e.is_a?(first.class) && first.class.to_s != "Hash" } ? ActiveSupport::Inflector.pluralize(ActiveSupport::Inflector.underscore(first.class.name)).tr('/', '_') : "records" options[:children] ||= options[:root].singularize options[:indent] ||= 2 options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent]) |