From 8dcfc5d0814942edfb8bb07366fd2a57bdea3512 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Thu, 4 Dec 2014 11:47:22 +0900 Subject: Prevent Symbol GC --- activerecord/test/cases/finder_test.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'activerecord') diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb index f24b30c685..d4272bb9d1 100644 --- a/activerecord/test/cases/finder_test.rb +++ b/activerecord/test/cases/finder_test.rb @@ -53,10 +53,13 @@ class FinderTest < ActiveRecord::TestCase end def test_symbols_table_ref + gc_disabled = GC.disable if RUBY_VERSION >= '2.2.0' Post.where("author_id" => nil) # warm up x = Symbol.all_symbols.count Post.where("title" => {"xxxqqqq" => "bar"}) assert_equal x, Symbol.all_symbols.count + ensure + GC.enable if gc_disabled == false end # find should handle strings that come from URLs -- cgit v1.2.3