Don't abuse as_json, it's not meant for consumption

The `as_json` API is a hook for JSON encoders to call, not meant for
consumption like this, and the result is not guarenteed to be stable
across Rails versions.

There might be other cases like this that we should revisit later, but
this one in particular is causing a test to fail on Rails master.
Merge pull request #1708 from chancancode/dont_abuse_as_json

Don't abuse as_json, it's not meant for consumption