Permalink
Browse files

Serializer#to_xml should use _root as default

  • Loading branch information...
1 parent 91efab9 commit d801e1cee4f2ccf5ab84224ff797ba7d723dc45b Trym Skaar committed Mar 31, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/active_model/serializer.rb
@@ -408,8 +408,8 @@ def as_json(options=nil)
end
end
- def to_xml(*args)
- serializable_hash.to_xml(*args)
+ def to_xml(options={})
+ serializable_hash.to_xml({ root: @options.fetch(:root, _root) }.merge options)
end
# Returns a hash representation of the serializable

0 comments on commit d801e1c

Please sign in to comment.