From 22d3d5a3b0d88d4411e8e13282af6546b654ae2d Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 10 Oct 2009 15:09:19 +0000 Subject: [PATCH] Defines String#to_a (Object#to_a removed in ruby1.9). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2912 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/core_ext/string/conversions.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/redmine/core_ext/string/conversions.rb b/lib/redmine/core_ext/string/conversions.rb index 68fbcde75..0d1d32f58 100644 --- a/lib/redmine/core_ext/string/conversions.rb +++ b/lib/redmine/core_ext/string/conversions.rb @@ -36,6 +36,13 @@ module Redmine #:nodoc: s.gsub!(',', '.') begin; Kernel.Float(s); rescue; nil; end end + + # Object#to_a removed in ruby1.9 + if RUBY_VERSION > '1.9' + def to_a + [self.dup] + end + end end end end