From 28ab79d7c579fa1d76ac868be02b38b02818428a Mon Sep 17 00:00:00 2001 From: James Harton Date: Thu, 31 Jan 2013 13:59:09 +1300 Subject: Modify TimeWithZone#as_json to return 3DP of sub-second accuracy by default, since it's allowed by the spec and is very useful. --- activesupport/lib/active_support/time_with_zone.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/time_with_zone.rb') diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb index ff13efa990..0e6d12a186 100644 --- a/activesupport/lib/active_support/time_with_zone.rb +++ b/activesupport/lib/active_support/time_with_zone.rb @@ -154,7 +154,7 @@ module ActiveSupport # # => "2005/02/01 15:15:10 +0000" def as_json(options = nil) if ActiveSupport::JSON::Encoding.use_standard_json_time_format - xmlschema + xmlschema(3) else %(#{time.strftime("%Y/%m/%d %H:%M:%S")} #{formatted_offset(false)}) end -- cgit v1.2.3