aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2013-07-08 19:51:15 +0900
committerAkira Matsuda <ronnie@dio.jp>2013-07-10 00:40:11 +0900
commit54eee8b5f28e05376626e98650d4bde8b8451603 (patch)
tree277949c8d93173ddf04a65fefb8889ac2f0e2cd2 /activerecord/test/cases/associations
parentc42260a3251157070a1bafadd179e4441df8933e (diff)
downloadrails-54eee8b5f28e05376626e98650d4bde8b8451603.tar.gz
rails-54eee8b5f28e05376626e98650d4bde8b8451603.tar.bz2
rails-54eee8b5f28e05376626e98650d4bde8b8451603.zip
Make sure that a joins Relation can be merged with has_many :through + association proxy
Closes #11248.
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r--activerecord/test/cases/associations/has_many_through_associations_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb
index ee88fd490a..119e94b831 100644
--- a/activerecord/test/cases/associations/has_many_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -5,6 +5,7 @@ require 'models/reference'
require 'models/job'
require 'models/reader'
require 'models/comment'
+require 'models/rating'
require 'models/tag'
require 'models/tagging'
require 'models/author'
@@ -616,6 +617,11 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
assert_equal post.author.author_favorites, post.author_favorites
end
+ def test_merge_join_association_with_has_many_through_association_proxy
+ author = authors(:mary)
+ assert_nothing_raised { author.comments.ratings.to_sql }
+ end
+
def test_has_many_association_through_a_has_many_association_with_nonstandard_primary_keys
assert_equal 2, owners(:blackbeard).toys.count
end