added support for as_json, which Rails uses for serialization.
Merge pull request #54 from attachmentsme/rails-json-serialization

added support for as_json, which Rails uses for serialization.