diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2013-11-14 14:43:14 -0800 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2013-11-14 14:43:14 -0800 |
commit | 421c81bd1875eb4e163bea8ce18b1ae9c2224e7d (patch) | |
tree | 87283624cbe5b1a1e5398011424e5b74acc0af9c /activerecord/test | |
parent | e15ea62b26e010d02459f8a2438f5a281cc1dd8f (diff) | |
download | rails-421c81bd1875eb4e163bea8ce18b1ae9c2224e7d.tar.gz rails-421c81bd1875eb4e163bea8ce18b1ae9c2224e7d.tar.bz2 rails-421c81bd1875eb4e163bea8ce18b1ae9c2224e7d.zip |
Fix that eager loading of polymorphic associations did not work with association empty?/any? predicates any more (there is still a problem when select is applied to a relation, or if you try association#exists? -- but its easier to work around)
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/associations/eager_test.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/associations/inner_join_association_test.rb | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index fa54eb28b4..498a4e8144 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -1188,8 +1188,6 @@ class EagerAssociationTest < ActiveRecord::TestCase end test "preloading with a polymorphic association and using the existential predicate" do - skip 'broken test' - assert_equal authors(:david), authors(:david).essays.includes(:writer).first.writer assert_nothing_raised do diff --git a/activerecord/test/cases/associations/inner_join_association_test.rb b/activerecord/test/cases/associations/inner_join_association_test.rb index 9fe5ff50d9..dffee42e7d 100644 --- a/activerecord/test/cases/associations/inner_join_association_test.rb +++ b/activerecord/test/cases/associations/inner_join_association_test.rb @@ -70,7 +70,7 @@ class InnerJoinAssociationTest < ActiveRecord::TestCase end def test_find_with_implicit_inner_joins_does_not_set_associations - authors = Author.joins(:posts).select('authors.*') + authors = Author.joins(:posts).select('authors.*').to_a assert !authors.empty?, "expected authors to be non-empty" assert authors.all? { |a| !a.instance_variable_defined?(:@posts) }, "expected no authors to have the @posts association loaded" end |