Permalink
Browse files

Fix todo Time.xmlschema used instead of Time.parse

  • Loading branch information...
1 parent 82857ad commit 4fe6d01a3b3bd9fc8b3c443f4e8f8b486203bb08 @vatrai vatrai committed May 22, 2011
Showing with 2 additions and 3 deletions.
  1. +2 −3 activesupport/lib/active_support/xml_mini.rb
@@ -51,13 +51,12 @@ def content_type
"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) },

0 comments on commit 4fe6d01

Please sign in to comment.