From 8d87c80c19b7f0c0966fcfd52e7a6ed99d347a36 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Sun, 17 Jan 2010 04:25:59 +0530 Subject: Make Relation#reload force load the records immediately --- activerecord/test/cases/relations_test.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'activerecord/test/cases/relations_test.rb') diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 195889f1df..acf247d27b 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -68,10 +68,12 @@ class RelationTest < ActiveRecord::TestCase assert topics.loaded? - topics.reload - assert ! topics.loaded? + original_size = topics.to_a.size + Topic.create! :title => 'fake' - assert_queries(1) { topics.to_a } + assert_queries(1) { topics.reload } + assert_equal original_size + 1, topics.size + assert topics.loaded? end def test_finding_with_conditions -- cgit v1.2.3