Tutorials

Nested API parameter validation in Rails with ActiveModel::Validations
In an earlier project we had a few affiliate partners with a deep desire to interact with our system in an automated fashion. So, I naturally created a new basic API endpoint for them to send leads to our system. Then we started testing the integr...





Ruby - raise Exception.new or raise Exception - they're both the same | Arkency Blog
The way I’m raising the exception here is that I raise it without calling .new. This may look as if I’m raising a class, not an object.Some people asked me if this actually works and if it’s the same.We already know the short answer, so let’s dig ...



How to use railway-oriented business transactions to unclutter your Rails controllers - Remi Mercier
When your Rails app needs to handle multiple steps, your controllers’ methods can become a mess.Don’t despair, though. You can delegate sequential steps to business transactions and Marie-Kondo those messy controllers. I’ll show you how.Let’s keep...

Testing railway-oriented business transactions with Rspec - Remi Mercier
Railway-oriented business transactions are a great way to unclutter your Rails controllers. We’ve already seen how to write ‘em. Now let’s see how we can test ‘em. I’ll be using dry-transaction as a business transaction DSL and RSpec for testing. ...