aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorgbuesing <gbuesing@gmail.com>2008-05-18 11:48:33 -0500
committergbuesing <gbuesing@gmail.com>2008-05-18 11:48:33 -0500
commitcee9297c9bd43ca8975dc7ca9b707a6aa94c275d (patch)
treec9ec24413cfd557c0ab0e2d15ab1877fb489e544 /activesupport/lib
parentcde9c09a524a21214ea9cd0f9ee4489e4d185af2 (diff)
downloadrails-cee9297c9bd43ca8975dc7ca9b707a6aa94c275d.tar.gz
rails-cee9297c9bd43ca8975dc7ca9b707a6aa94c275d.tar.bz2
rails-cee9297c9bd43ca8975dc7ca9b707a6aa94c275d.zip
Hash.from_xml: datetime xml types overflow to Ruby DateTime class when out of range of Time. Adding tests for utc offsets
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/hash/conversions.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/conversions.rb b/activesupport/lib/active_support/core_ext/hash/conversions.rb
index 3d6a8d8588..a023118885 100644
--- a/activesupport/lib/active_support/core_ext/hash/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/hash/conversions.rb
@@ -70,7 +70,7 @@ module ActiveSupport #:nodoc:
XML_PARSING = {
"symbol" => Proc.new { |symbol| symbol.to_sym },
"date" => Proc.new { |date| ::Date.parse(date) },
- "datetime" => Proc.new { |time| ::Time.parse(time).utc },
+ "datetime" => Proc.new { |time| ::Time.parse(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) },