rails/rails — pull request #9128 by jamesotron (2013-01-31 01:19:17+00:00)
Title: Modify TimeWithZone#as_json to return 3DP of sub-second accuracy.

The ISO8601 spec says that decimal fractions may be added for the seconds (actually any) value. The default in recent versions of Firefox, Chrome and Safari (that I have tested) all return 3 decimal places of accuracy for seconds for their default serialisation:

```javascript
(new Date()).toJSON()
"2013-01-31T01:15:22.236Z"
```

I ran into this in an app using rails-api/active_model_serializers, and initially intended to submit a PR there, but soon discovered that it uses ActiveSupport's default JSON encodings.

It's a very simple change, so I've updated the one test for this method and added a changelog entry. Tests pass on my machine. Please let me know if there's anything I've missed and I'll clean it up immediately.