diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-05-18 10:42:26 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-07-04 07:28:44 +0900 |
commit | 2bfa2c02a891d4817832807343c6f1d56e9bae50 (patch) | |
tree | 4e9d767231cb3adf0518368875b81a1b57ae8428 /activerecord/test/cases | |
parent | 4aa76ed38a8609ad713e2b39ccb1fa97c5c64682 (diff) | |
download | rails-2bfa2c02a891d4817832807343c6f1d56e9bae50.tar.gz rails-2bfa2c02a891d4817832807343c6f1d56e9bae50.tar.bz2 rails-2bfa2c02a891d4817832807343c6f1d56e9bae50.zip |
Fix preloading association with scope including joins
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/associations/eager_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index 55b294cfaa..db8248dd99 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -68,6 +68,10 @@ class EagerAssociationTest < ActiveRecord::TestCase "expected to find only david's posts" end + def test_loading_with_scope_including_joins + assert_equal clubs(:boring_club), Member.preload(:general_club).find(1).general_club + end + def test_with_ordering list = Post.all.merge!(includes: :comments, order: "posts.id DESC").to_a [:other_by_mary, :other_by_bob, :misc_by_mary, :misc_by_bob, :eager_other, |