aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/time_with_zone.rb
diff options
context:
space:
mode:
authorJames Harton <jamesotron@gmail.com>2013-01-31 13:59:09 +1300
committerJames Harton <jamesotron@gmail.com>2013-01-31 14:11:51 +1300
commit28ab79d7c579fa1d76ac868be02b38b02818428a (patch)
treebde101bf8eea9c5a8d5ddbd5886d30a619acffa0 /activesupport/lib/active_support/time_with_zone.rb
parent162f7c1edcc45074aca482b4688a08e8ab41083f (diff)
downloadrails-28ab79d7c579fa1d76ac868be02b38b02818428a.tar.gz
rails-28ab79d7c579fa1d76ac868be02b38b02818428a.tar.bz2
rails-28ab79d7c579fa1d76ac868be02b38b02818428a.zip
Modify TimeWithZone#as_json to return 3DP of sub-second accuracy by default, since it's allowed by the spec and is very useful.
Diffstat (limited to 'activesupport/lib/active_support/time_with_zone.rb')
-rw-r--r--activesupport/lib/active_support/time_with_zone.rb2
1 files changed, 1 insertions, 1 deletions
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