mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Order is not guaranteed here, ordering by id of people table makes it work
This commit is contained in:
parent
ccc8eba4dc
commit
efbd0eb9f7
1 changed files with 2 additions and 2 deletions
|
@ -41,9 +41,9 @@ class CascadedEagerLoadingTest < ActiveRecord::TestCase
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue