mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix todo Time.xmlschema used instead of Time.parse
This commit is contained in:
parent
82857adc56
commit
4fe6d01a3b
1 changed files with 2 additions and 3 deletions
|
@ -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) },
|
||||
|
|
Loading…
Reference in a new issue