提交 efbd0eb9 编写于 作者: S Santiago Pastorino 提交者: Jeremy Kemper

Order is not guaranteed here, ordering by id of people table makes it work

上级 ccc8eba4
......@@ -41,9 +41,9 @@ def test_eager_association_loading_with_hmt_does_not_table_name_collide_when_joi
def test_eager_association_loading_grafts_stashed_associations_to_correct_parent
assert_nothing_raised do
Person.eager_load(:primary_contact => :primary_contact).where('primary_contacts_people_2.first_name = ?', 'Susan').order('primary_contacts_people_2.id').all
Person.eager_load(:primary_contact => :primary_contact).where('primary_contacts_people_2.first_name = ?', 'Susan').order('people.id').all
end
assert_equal people(:michael), Person.eager_load(:primary_contact => :primary_contact).where('primary_contacts_people_2.first_name = ?', 'Susan').order('primary_contacts_people_2.id').first
assert_equal people(:michael), Person.eager_load(:primary_contact => :primary_contact).where('primary_contacts_people_2.first_name = ?', 'Susan').order('people.id').first
end
def test_eager_association_loading_with_cascaded_two_levels_with_two_has_many_associations
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册