Refactor the as_json hack out to use a new gem I wrote specifically to handle stuff like this. :D