aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorVishnu Atrai <me@vishnuatrai.com>2011-05-22 11:17:32 +0530
committerVishnu Atrai <me@vishnuatrai.com>2011-05-22 11:17:32 +0530
commit4fe6d01a3b3bd9fc8b3c443f4e8f8b486203bb08 (patch)
tree3a448f57d6dc417a3f2b02a71509afe4f6189c86 /activesupport
parent82857adc56efd16d22821971fff4c5e24a3c5b55 (diff)
downloadrails-4fe6d01a3b3bd9fc8b3c443f4e8f8b486203bb08.tar.gz
rails-4fe6d01a3b3bd9fc8b3c443f4e8f8b486203bb08.tar.bz2
rails-4fe6d01a3b3bd9fc8b3c443f4e8f8b486203bb08.zip
Fix todo Time.xmlschema used instead of Time.parse
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/xml_mini.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/xml_mini.rb b/activesupport/lib/active_support/xml_mini.rb
index 6e12404ad4..78c78015d2 100644
--- a/activesupport/lib/active_support/xml_mini.rb
+++ b/activesupport/lib/active_support/xml_mini.rb
@@ -51,13 +51,12 @@ module ActiveSupport
"yaml" => Proc.new { |yaml| yaml.to_yaml }
} unless defined?(FORMATTING)
- # TODO: use Time.xmlschema instead of Time.parse;
- # use regexp instead of Date.parse
+ # TODO use regexp instead of Date.parse
unless defined?(PARSING)
PARSING = {
"symbol" => Proc.new { |symbol| symbol.to_sym },
"date" => Proc.new { |date| ::Date.parse(date) },
- "datetime" => Proc.new { |time| ::Time.parse(time).utc rescue ::DateTime.parse(time).utc },
+ "datetime" => Proc.new { |time| ::Time.xmlschema(time).utc rescue ::DateTime.parse(time).utc },
"integer" => Proc.new { |integer| integer.to_i },
"float" => Proc.new { |float| float.to_f },
"decimal" => Proc.new { |number| BigDecimal(number) },