aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/eager_test.rb
diff options
context:
space:
mode:
authorMingdong Luo <mdluo@nsmss.com>2015-01-31 19:23:48 -0800
committerMingdong Luo <mdluo@nsmss.com>2015-01-31 19:23:48 -0800
commit549d171a90135999e3c670f489494b7a39dd6dd7 (patch)
tree233466527b797fe3ea7c6a7a3673795cea28aebe /activerecord/test/cases/associations/eager_test.rb
parentc840b18ac31a852d99ff760229f2c087b6961727 (diff)
parent70ac072976c8cc6f013f0df3777e54ccae3f4f8c (diff)
downloadrails-549d171a90135999e3c670f489494b7a39dd6dd7.tar.gz
rails-549d171a90135999e3c670f489494b7a39dd6dd7.tar.bz2
rails-549d171a90135999e3c670f489494b7a39dd6dd7.zip
Merge branch 'master' into pr/18316
Conflicts: activerecord/CHANGELOG.md
Diffstat (limited to 'activerecord/test/cases/associations/eager_test.rb')
-rw-r--r--activerecord/test/cases/associations/eager_test.rb31
1 files changed, 9 insertions, 22 deletions
diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb
index 1d00177405..7d8b933992 100644
--- a/activerecord/test/cases/associations/eager_test.rb
+++ b/activerecord/test/cases/associations/eager_test.rb
@@ -834,18 +834,6 @@ class EagerAssociationTest < ActiveRecord::TestCase
)
end
- def test_preload_with_interpolation
- assert_deprecated do
- post = Post.includes(:comments_with_interpolated_conditions).find(posts(:welcome).id)
- assert_equal [comments(:greetings)], post.comments_with_interpolated_conditions
- end
-
- assert_deprecated do
- post = Post.joins(:comments_with_interpolated_conditions).find(posts(:welcome).id)
- assert_equal [comments(:greetings)], post.comments_with_interpolated_conditions
- end
- end
-
def test_polymorphic_type_condition
post = Post.all.merge!(:includes => :taggings).find(posts(:thinking).id)
assert post.taggings.include?(taggings(:thinking_general))
@@ -1302,23 +1290,22 @@ class EagerAssociationTest < ActiveRecord::TestCase
assert_equal pets(:parrot), Owner.including_last_pet.first.last_pet
end
- test "include instance dependent associations is deprecated" do
+ test "preloading and eager loading of instance dependent associations is not supported" do
message = "association scope 'posts_with_signature' is"
- assert_deprecated message do
- begin
- Author.includes(:posts_with_signature).to_a
- rescue NoMethodError
- # it's expected that preloading of this association fails
- end
+ error = assert_raises(ArgumentError) do
+ Author.includes(:posts_with_signature).to_a
end
+ assert_match message, error.message
- assert_deprecated message do
- Author.preload(:posts_with_signature).to_a rescue NoMethodError
+ error = assert_raises(ArgumentError) do
+ Author.preload(:posts_with_signature).to_a
end
+ assert_match message, error.message
- assert_deprecated message do
+ error = assert_raises(ArgumentError) do
Author.eager_load(:posts_with_signature).to_a
end
+ assert_match message, error.message
end
test "preloading readonly association" do