Skip to content

Commit 2c0b107

Browse files
kamipomatthewd
authored andcommitted
Prevent Symbol GC
1 parent b427c50 commit 2c0b107

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

activerecord/test/cases/finder_test.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,13 @@ def test_find_passing_active_record_object_is_deprecated
5555
end
5656

5757
def test_symbols_table_ref
58+
gc_disabled = GC.disable
5859
Post.where("author_id" => nil) # warm up
5960
x = Symbol.all_symbols.count
6061
Post.where("title" => {"xxxqqqq" => "bar"})
6162
assert_equal x, Symbol.all_symbols.count
63+
ensure
64+
GC.enable if gc_disabled == false
6265
end
6366

6467
# find should handle strings that come from URLs

0 commit comments

Comments
 (0)