The Rails JSON encoder API requires `as_json` to take an optional arg

This bug is not triggered on Rails 4, but some patches to the JSON encoder in master caused this bug to surface.