提交 8233f831 编写于 作者: W Will Bryant 提交者: Michael Koziarski

wrote a test showing eager loading's misbehavior (sanitizing against the wrong...

wrote a test showing eager loading's misbehavior (sanitizing against the wrong table) when the association has a :conditions hash
Signed-off-by: NMichael Koziarski <michael@koziarski.com>
上级 8c105ee0
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册