| | 393 | |
|---|
| | 394 | def test_eager_load_with_inner_join |
|---|
| | 395 | assert_not_nil posts(:welcome) |
|---|
| | 396 | assert posts(:welcome).people.size > 0 |
|---|
| | 397 | assert posts(:welcome).people.find(:all).size > 0 |
|---|
| | 398 | id = posts(:welcome).id |
|---|
| | 399 | assert_equal posts(:welcome).people.find(:all).size, posts(:welcome).people.find(:all, :include => :posts).size |
|---|
| | 400 | assert_equal posts(:welcome).people.find(:all).size, People.find(:all, :include => :posts, :joins => 'inner join readers on readers.person_id = people.person_id', :conditions => ['readers.post_id = ?',id]).size |
|---|
| | 401 | end |
|---|
| | 402 | |
|---|