summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-10-10 15:09:19 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-10-10 15:09:19 +0000
commit22d3d5a3b0d88d4411e8e13282af6546b654ae2d (patch)
tree85139529013c21f3af4d7f8ab9f4d21484af3842
parent531eb6555777b4fd698f0da317732b188a0df20b (diff)
downloadredmine-22d3d5a3b0d88d4411e8e13282af6546b654ae2d.tar.gz
redmine-22d3d5a3b0d88d4411e8e13282af6546b654ae2d.zip
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
-rw-r--r--lib/redmine/core_ext/string/conversions.rb7
1 files changed, 7 insertions, 0 deletions
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