aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/json/backends/jsongem.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/json/backends/jsongem.rb')
-rw-r--r--activesupport/lib/active_support/json/backends/jsongem.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/json/backends/jsongem.rb b/activesupport/lib/active_support/json/backends/jsongem.rb
index cfe28d7bb9..533ba25da3 100644
--- a/activesupport/lib/active_support/json/backends/jsongem.rb
+++ b/activesupport/lib/active_support/json/backends/jsongem.rb
@@ -26,7 +26,11 @@ module ActiveSupport
when nil
nil
when DATE_REGEX
- DateTime.parse(data)
+ begin
+ DateTime.parse(data)
+ rescue ArgumentError
+ data
+ end
when Array
data.map! { |d| convert_dates_from(d) }
when Hash