From 54eee8b5f28e05376626e98650d4bde8b8451603 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Mon, 8 Jul 2013 19:51:15 +0900 Subject: Make sure that a joins Relation can be merged with has_many :through + association proxy Closes #11248. --- .../test/cases/associations/has_many_through_associations_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activerecord/test/cases/associations') 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 -- cgit v1.2.3