It’s an interesting exploration. I’m not quite in favour of it. I reckon that in a busy codebase the = transaction do will be easy to miss, while the extra block is clearer.
I don’t think the goal should be “less lines” rather it should be “more clarity”.
If I wanted to “wrap” things in transactions then I might lean towards meta-programming 😱 and have a class method that takes a symbol of the method name and wrap that in a transaction by renaming the method. E.g transaction def update_fnargle …
But I’d think long and hard if that is enough of a gain in clarity before I lean on either technique.
Mark Linda
I can teach you how to turn your $200 into $5,500 in just 2hours without sending money to anyone
I can teach you how to turn your $200 into $8,500 in 2hours without interrupting your daily activities and it's 100% legitimate and secure TEXT ME IF YOU ARE INTERESTED FOR MORE INFORM WITH THE DETAILS BELOW
WHATSAPP NO: +1 (774) 493‑3224