aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/eager_test.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-05-18 10:42:26 +0900
committerRyuta Kamizono <kamipo@gmail.com>2017-07-04 07:28:44 +0900
commit2bfa2c02a891d4817832807343c6f1d56e9bae50 (patch)
tree4e9d767231cb3adf0518368875b81a1b57ae8428 /activerecord/test/cases/associations/eager_test.rb
parent4aa76ed38a8609ad713e2b39ccb1fa97c5c64682 (diff)
downloadrails-2bfa2c02a891d4817832807343c6f1d56e9bae50.tar.gz
rails-2bfa2c02a891d4817832807343c6f1d56e9bae50.tar.bz2
rails-2bfa2c02a891d4817832807343c6f1d56e9bae50.zip
Fix preloading association with scope including joins
Diffstat (limited to 'activerecord/test/cases/associations/eager_test.rb')
-rw-r--r--activerecord/test/cases/associations/eager_test.rb4
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,