aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/test/cases/identity_map_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/identity_map_test.rb b/activerecord/test/cases/identity_map_test.rb
index 3efc8bf559..0d031d433c 100644
--- a/activerecord/test/cases/identity_map_test.rb
+++ b/activerecord/test/cases/identity_map_test.rb
@@ -162,6 +162,14 @@ class IdentityMapTest < ActiveRecord::TestCase
c2 = Comment.find(c.id)
assert_same(c1, c2)
end
+
+ def test_queries_are_not_executed_when_finding_inherited_class_by_id
+ c = comments(:sub_special_comment)
+ SubSpecialComment.find(c.id)
+ assert_no_queries do
+ SubSpecialComment.find(c.id)
+ end
+ end
##############################################################################
# Tests checking dirty attribute behavior with IM #