aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2010-12-22 10:13:21 +0000
committerAaron Patterson <aaron.patterson@gmail.com>2010-12-23 15:19:18 -0800
commit1619c2435b2b9c821b2b0dcab9624dbb6b23eaaa (patch)
treea07493a80002b29b2e0202a451b9c3ab2d7dd22b /activerecord/test/cases/associations
parent4e13625818579551c01640cb405a8c22a3bd0e68 (diff)
downloadrails-1619c2435b2b9c821b2b0dcab9624dbb6b23eaaa.tar.gz
rails-1619c2435b2b9c821b2b0dcab9624dbb6b23eaaa.tar.bz2
rails-1619c2435b2b9c821b2b0dcab9624dbb6b23eaaa.zip
Revert "Optimize <association>_ids for hm:t with belongs_to source". The optimisation has too many edge cases, such as when the reflection, source reflection, or through reflection has conditions, orders, etc. [#6153 state:resolved]
This reverts commit 373b053dc8b99dac1abc3879a17a2bf8c30302b5. Conflicts: activerecord/lib/active_record/associations.rb
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r--activerecord/test/cases/associations/has_many_through_associations_test.rb8
1 files changed, 2 insertions, 6 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 ad67886202..a244d310c8 100644
--- a/activerecord/test/cases/associations/has_many_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -334,12 +334,8 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
assert_equal 2, people(:michael).jobs.size
end
- def test_get_ids_for_belongs_to_source
- assert_sql(/DISTINCT/) { assert_equal [posts(:welcome).id, posts(:authorless).id].sort, people(:michael).post_ids.sort }
- end
-
- def test_get_ids_for_has_many_source
- assert_equal [comments(:eager_other_comment1).id], authors(:mary).comment_ids
+ def test_get_ids
+ assert_equal [posts(:welcome).id, posts(:authorless).id].sort, people(:michael).post_ids.sort
end
def test_get_ids_for_loaded_associations