diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-28 09:53:12 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-28 09:53:12 -0800 |
commit | 422906d06c60ee3efa54cb26960aadda1adef2ce (patch) | |
tree | 7b42180d9eb2061e39d4a6eacb256fa25817b157 /activerecord/test/cases | |
parent | 6ef34603d2d05a81f2f556211d9eb1c0fbb7537e (diff) | |
parent | d1e7cd14c29f1ef45f2f36e79cd99eb580036991 (diff) | |
download | rails-422906d06c60ee3efa54cb26960aadda1adef2ce.tar.gz rails-422906d06c60ee3efa54cb26960aadda1adef2ce.tar.bz2 rails-422906d06c60ee3efa54cb26960aadda1adef2ce.zip |
Merge pull request #14226 from senny/14109_partial_revert
`includes` uses SQL parsing when String joins are involved.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/associations/eager_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index 498a4e8144..5522a33b79 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -1194,4 +1194,13 @@ class EagerAssociationTest < ActiveRecord::TestCase authors(:david).essays.includes(:writer).any? end end + + test "preloading associations with string joins and order references" do + author = assert_queries(2) { + Author.includes(:posts).joins("LEFT JOIN posts ON posts.author_id = authors.id").order("posts.title DESC").first + } + assert_no_queries { + assert_equal 5, author.posts.size + } + end end |