Skip to content
Browse files

Fix spurious newlines and spaces in AR::Base#to_xml output

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4862 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent ff063d7 commit 3ea2549e7a9c2d6c1ad9c1c773a5c568e3cba15d @jamis jamis committed Aug 30, 2006
Showing with 8 additions and 14 deletions.
  1. +2 −0 activerecord/CHANGELOG
  2. +6 −14 activerecord/lib/active_record/xml_serialization.rb
View
2 activerecord/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Fix spurious newlines and spaces in AR::Base#to_xml output [Jamis Buck]
+
* has_one supports the :dependent => :delete option which skips the typical callback chain and deletes the associated object directly from the database. #5927 [Chris Mear, Jonathan Viney]
* Nested subclasses are not prefixed with the parent class' table_name since they should always use the base class' table_name. #5911 [Jonathan Viney]
View
20 activerecord/lib/active_record/xml_serialization.rb
@@ -214,19 +214,11 @@ def add_procs
def add_tag(attribute)
- if attribute.needs_encoding?
- builder.tag!(
- dasherize? ? attribute.name.dasherize : attribute.name,
- attribute.value.to_s,
- attribute.decorations(!options[:skip_types])
- )
- else
- builder.tag!(
- dasherize? ? attribute.name.dasherize : attribute.name,
- attribute.decorations(!options[:skip_types])) do
- builder << attribute.value.to_s
- end
- end
+ builder.tag!(
+ dasherize? ? attribute.name.dasherize : attribute.name,
+ attribute.value.to_s,
+ attribute.decorations(!options[:skip_types])
+ )
end
def serialize
@@ -308,4 +300,4 @@ def compute_type
end
end
end
-end
+end

0 comments on commit 3ea2549

Please sign in to comment.
Something went wrong with that request. Please try again.