aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2014-08-18 04:13:18 +0900
committerAkira Matsuda <ronnie@dio.jp>2014-08-18 04:20:20 +0900
commit393e19e508a08ede0f5037bccb984e3eb252d579 (patch)
tree82c5ac292a53be5dba2e064b93d713068ba3c470 /activesupport/lib
parent80ceb0be7c982150eb2f868ed5e1a56a376fb2cb (diff)
downloadrails-393e19e508a08ede0f5037bccb984e3eb252d579.tar.gz
rails-393e19e508a08ede0f5037bccb984e3eb252d579.tar.bz2
rails-393e19e508a08ede0f5037bccb984e3eb252d579.zip
Preload UnicodeDatabase outside the loop
This fixes random multibyte_chars_test fail under Ruby 1.9.3. I don't know why the tests fail. And I really don't know why this fixes. Maybe we need some more investigation...
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/multibyte/unicode.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/multibyte/unicode.rb b/activesupport/lib/active_support/multibyte/unicode.rb
index a4467e0edc..89009d1f55 100644
--- a/activesupport/lib/active_support/multibyte/unicode.rb
+++ b/activesupport/lib/active_support/multibyte/unicode.rb
@@ -368,6 +368,7 @@ module ActiveSupport
private
def apply_mapping(string, mapping) #:nodoc:
+ database.codepoints
string.each_codepoint.map do |codepoint|
cp = database.codepoints[codepoint]
if cp and (ncp = cp.send(mapping)) and ncp > 0