public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
wrote a test showing eager loading's misbehavior (sanitizing against the wrong 
table) when the association has a :conditions hash

Signed-off-by: Michael Koziarski <michael@koziarski.com>
Will Bryant (author)
Tue Sep 23 21:44:56 -0700 2008
NZKoz (committer)
Mon Sep 29 08:49:44 -0700 2008
commit  8233f8314ba00838e8ef6b2d95cdfb7d58c8dece
tree    ca3cbb3d6c168f5d9dc705f2b5c973977de4080a
parent  8c105ee0c888a63cdbf593f0bfe688065b3e09e2
...
116
117
118
 
 
 
 
 
 
 
119
120
121
...
116
117
118
119
120
121
122
123
124
125
126
127
128
0
@@ -116,6 +116,13 @@ class EagerAssociationTest < ActiveRecord::TestCase
0
     assert_equal 2, posts.first.comments.size
0
   end
0
 
0
+  def test_loading_from_an_association_that_has_a_hash_of_conditions
0
+    assert_nothing_raised do
0
+      Author.find(:all, :include => :hello_posts_with_hash_conditions)
0
+    end
0
+    assert !Author.find(authors(:david).id, :include => :hello_posts_with_hash_conditions).hello_posts.empty?
0
+  end
0
+
0
   def test_loading_with_no_associations
0
     assert_nil Post.find(posts(:authorless).id, :include => :author).author
0
   end

Comments