Assume `to_json` to be safe in Rails 4
Add tests for `to_json` in Rails 4