aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-07-04 16:25:59 -0400
committerGitHub <noreply@github.com>2017-07-04 16:25:59 -0400
commit990a4dbbca5b7a8cf3d01861cb66deae456d370e (patch)
treeedb975a361cc1d69c0812b91d4fbf555886e0842 /activerecord/test/cases
parentf01eb5b92c80b7a78bb6b1d9d713a2b8d2cf90d8 (diff)
parentdb3ff259ea7c9b4c3660c0476e847907f90b762e (diff)
downloadrails-990a4dbbca5b7a8cf3d01861cb66deae456d370e.tar.gz
rails-990a4dbbca5b7a8cf3d01861cb66deae456d370e.tar.bz2
rails-990a4dbbca5b7a8cf3d01861cb66deae456d370e.zip
Merge pull request #29413 from kamipo/fix_association_with_scope_including_joins
Fix association with scope including joins
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/associations/eager_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb
index 55b294cfaa..c0bab19e82 100644
--- a/activerecord/test/cases/associations/eager_test.rb
+++ b/activerecord/test/cases/associations/eager_test.rb
@@ -68,6 +68,11 @@ 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
+ assert_equal clubs(:boring_club), Member.eager_load(: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,