adding fix for to_xml for ActiveRecord relation object

Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
Neeraj Singh 2010-06-23 11:54:38 -04:00 committed by José Valim
parent eb04408a20
commit 0bf3baa6b3
2 changed files with 6 additions and 1 deletions

@ -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

@ -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