Permalink
Browse files

adding fix for to_xml for ActiveRecord relation object

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent eb04408 commit 0bf3baa6b3d216c6340f8d3b5d0a3ebc093e969a Neeraj Singh committed with josevalim Jun 23, 2010
Showing with 6 additions and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/relation.rb
  2. +5 −0 activerecord/test/cases/relations_test.rb
View
2 activerecord/lib/active_record/relation.rb
@@ -10,7 +10,7 @@ class Relation
include FinderMethods, Calculations, SpawnMethods, QueryMethods, Batches
- delegate :to_json, :to_yaml, :length, :collect, :map, :each, :all?, :include?, :to => :to_a
+ delegate :to_xml, :to_json, :to_yaml, :length, :collect, :map, :each, :all?, :include?, :to => :to_a
delegate :insert, :to => :arel
attr_reader :table, :klass
View
5 activerecord/test/cases/relations_test.rb
@@ -39,6 +39,11 @@ def test_to_yaml
assert_nothing_raised { Bird.scoped.all.to_yaml }
end
+ def test_to_xml
+ assert_nothing_raised { Bird.scoped.to_xml }
+ assert_nothing_raised { Bird.scoped.all.to_xml }
+ end
+
def test_scoped_all
topics = Topic.scoped.all
assert_kind_of Array, topics

0 comments on commit 0bf3baa

Please sign in to comment.