![]() In order to protect us from rendering a resource simply converted to json, without processing it with API data class, this commit changes JSON responder behavior to render 404 if we can't find associated data class. The only exception to that rule is when resource is already a Hash, meaning that it was processed before - we sometimes return for example simple Hash responses like { result: true }. The Hash exception could allow to accidentally pass resource.as_json to responder, but in travis-ci/travis-support@124b8b6 I disabled default as_json method on AR::Base classes, so the risk of such mistake is lowered. |
||
---|---|---|
.. | ||
json_spec.rb | ||
service_spec.rb |