diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-07-27 12:01:25 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-07-27 13:34:12 +0100 |
commit | 6a81ccd69d96f36f4322ef927191ab5a35e68d68 (patch) | |
tree | eefd3b92255fa3969e412c88633332a47808f3c5 /activerecord/test/cases/associations/eager_singularization_test.rb | |
parent | f1afd7765c2a35cc77e1ee40466db36f181e29f5 (diff) | |
download | rails-6a81ccd69d96f36f4322ef927191ab5a35e68d68.tar.gz rails-6a81ccd69d96f36f4322ef927191ab5a35e68d68.tar.bz2 rails-6a81ccd69d96f36f4322ef927191ab5a35e68d68.zip |
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.
Diffstat (limited to 'activerecord/test/cases/associations/eager_singularization_test.rb')
-rw-r--r-- | activerecord/test/cases/associations/eager_singularization_test.rb | 14 |
1 files changed, 7 insertions, 7 deletions
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 |