mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
adding fix for to_xml for ActiveRecord relation object
Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
parent
eb04408a20
commit
0bf3baa6b3
2 changed files with 6 additions and 1 deletions
|
@ -10,7 +10,7 @@ module ActiveRecord
|
||||||
|
|
||||||
include FinderMethods, Calculations, SpawnMethods, QueryMethods, Batches
|
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
|
delegate :insert, :to => :arel
|
||||||
|
|
||||||
attr_reader :table, :klass
|
attr_reader :table, :klass
|
||||||
|
|
|
@ -39,6 +39,11 @@ class RelationTest < ActiveRecord::TestCase
|
||||||
assert_nothing_raised { Bird.scoped.all.to_yaml }
|
assert_nothing_raised { Bird.scoped.all.to_yaml }
|
||||||
end
|
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
|
def test_scoped_all
|
||||||
topics = Topic.scoped.all
|
topics = Topic.scoped.all
|
||||||
assert_kind_of Array, topics
|
assert_kind_of Array, topics
|
||||||
|
|
Loading…
Reference in a new issue