From 6a81ccd69d96f36f4322ef927191ab5a35e68d68 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Fri, 27 Jul 2012 12:01:25 +0100 Subject: ActiveRecord::Base.all returns a Relation. Previously it returned an Array. If you want an array, call e.g. `Post.to_a` rather than `Post.all`. This is more explicit. In most cases this should not break existing code, since Relations use method_missing to delegate unknown methods to #to_a anyway. --- .../test/cases/associations/eager_singularization_test.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'activerecord/test/cases/associations/eager_singularization_test.rb') diff --git a/activerecord/test/cases/associations/eager_singularization_test.rb b/activerecord/test/cases/associations/eager_singularization_test.rb index 5805e71249..4f96d63710 100644 --- a/activerecord/test/cases/associations/eager_singularization_test.rb +++ b/activerecord/test/cases/associations/eager_singularization_test.rb @@ -103,43 +103,43 @@ class EagerSingularizationTest < ActiveRecord::TestCase def test_eager_no_extra_singularization_belongs_to return unless @have_tables assert_nothing_raised do - Virus.scoped(:includes => :octopus).all + Virus.scoped(:includes => :octopus).to_a end end def test_eager_no_extra_singularization_has_one return unless @have_tables assert_nothing_raised do - Octopus.scoped(:includes => :virus).all + Octopus.scoped(:includes => :virus).to_a end end def test_eager_no_extra_singularization_has_many return unless @have_tables assert_nothing_raised do - Bus.scoped(:includes => :passes).all + Bus.scoped(:includes => :passes).to_a end end def test_eager_no_extra_singularization_has_and_belongs_to_many return unless @have_tables assert_nothing_raised do - Crisis.scoped(:includes => :messes).all - Mess.scoped(:includes => :crises).all + Crisis.scoped(:includes => :messes).to_a + Mess.scoped(:includes => :crises).to_a end end def test_eager_no_extra_singularization_has_many_through_belongs_to return unless @have_tables assert_nothing_raised do - Crisis.scoped(:includes => :successes).all + Crisis.scoped(:includes => :successes).to_a end end def test_eager_no_extra_singularization_has_many_through_has_many return unless @have_tables assert_nothing_raised do - Crisis.scoped(:includes => :compresses).all + Crisis.scoped(:includes => :compresses).to_a end end end -- cgit v1.2.3