Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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>
  • Loading branch information...
commit e34e6d67e3861dab5b6e21703c0fefa96e728158 1 parent 4526e35
@willbryant willbryant authored NZKoz committed
Showing with 7 additions and 0 deletions.
  1. +7 −0 activerecord/test/cases/associations/eager_test.rb
View
7 activerecord/test/cases/associations/eager_test.rb
@@ -116,6 +116,13 @@ def test_loading_from_an_association
assert_equal 2, posts.first.comments.size
end
+ def test_loading_from_an_association_that_has_a_hash_of_conditions
+ assert_nothing_raised do
+ Author.find(:all, :include => :hello_posts_with_hash_conditions)
+ end
+ assert !Author.find(authors(:david).id, :include => :hello_posts_with_hash_conditions).hello_posts.empty?
+ end
+
def test_loading_with_no_associations
assert_nil Post.find(posts(:authorless).id, :include => :author).author
end
Please sign in to comment.
Something went wrong with that request. Please try again.