Return Rich Result Objects, Not Booleans or Active Records
Learn about enhanced testing, and improved error handling, and ensuring a more seamless development process in Rails.
We'll cover the following
Enriching call results for clarity
A caller often needs to know what happened in the call they made. Not always, but often. Typical reasons are to report errors back to the user or to feed into the logic it needs to execute. As part of the seam between the outside world and our business logic, a boolean value—true
if the call succeeded, false
otherwise—is not very useful and can be hard to manage.
Get hands-on with 1400+ tech skills courses.