#​652 — May 4, 2023

Read on the Web

Together with  Cloud66 logo

Ruby Weekly

Retries Made Better with Faraday Loop — Ever need a simple way to retry a block of code in Ruby? Maybe with a maximum number of retries or exponential backoff? The popular Faraday HTTP client library has a great built-in solution that it uses for retrying HTTP requests which has been extracted into Faraday Loop for us to use elsewhere.

Nate Kontny (Census Engineering) / LostIsland

Triggering CI from Pull Requests and Force Pushes in GitHub Actions — I’d love to see more practical GitHub Actions tutorials like this as it can feel a little opaque. Here’s how the creators of slack-ruby-client auto generate pull requests based on Slack API updates.

Daniel Doubrovkine

Blue/Green Deployments for Rails on Any Cloud — Deploy Rails applications hassle-free on any cloud and in any region with full database support, custom traffic rules, zero-downtime deployments, blue/green and canary releases, WAF, and more. Try it today for free, and get $100 in credits with the code: RubyWeekly100

Cloud 66 sponsor

QUICK BITS

📕 Tutorials, Articles, and Videos

▶  VS Code Extensions for Ruby (That I Use) — A Rails YouTuber (videos here) explains what Visual Studio Code extensions he uses. None are Rails specific and could be used by any Rubyist.

Deanin

💡 There's also a new VS Code release just out with improvements to the terminal, new default dark and light color themes, support for profile templates, a built-in color picker, and numerous other things.

Frictionless Developer Environments with Nix — How do you know if someone uses Nix? Don’t worry – they’ll tell you! 😆 Seriously, though, there are enough benefits to be had that it’s worth understanding it as an option, even if you don’t use it.

Andrew Coleman

🚨 Rails 6.0 Is Hitting EOL on June 1st 🚨 Need to Upgrade Fast? — Let us help with your Ruby or Rails upgrade. Collaborate with the team behind the Rails Upgrade Workshop (RailsConf).

FastRuby․io | Ruby Tech Debt Services sponsor

Creating Custom Rails Generators — Rails generators can help remove friction from the process of spinning up new ideas, but you don’t have to limit yourself to the included ones..

Garrett Dimon

Rails' 'Dangerous Query Method' Deprecation — If you’ve updated a Rails app you might have seen a scary looking ‘Dangerous query method’ deprecation. Luckily, it’s easy to resolve and will make your app safer too.

Gelsey Torres (FastRuby)

Extending Ruby Classes with Modules — Back to some Ruby OO basics.

Paweł Dąbrowski

Integrate and Troubleshoot Inbound Emails with Action Mailbox in Rails
John Beatty

Polymorphic Associations in Rails: Why, What, and How
Akshay Khot

Using a Redlock Mutex to Avoid Duplicate Requests
Anthony Panozzo

Whatever You Do, Don't Autoload Rails lib/ — And why.
Ben Sheldon

🛠 Code & Tools

Authie 4.0: Database-Backed User Sessions for Rails — Makes it easier to invalidate sessions from afar without making changes to cookies or to see who is currently logged in.

Adam Cooke

MiniSql: A Minimal, Safe SQL Executor for Postgres and SQLite — Makes things nicer if you’re using pg or SQLite. If you get tangled up in the occasionally crufty native APIs for those, this could help ease things a bit.

Discourse

Flipping Out Over Flipper Feature Flags 🤪🏁 — Learn how to integrate feature flags into your Rails application using the Flipper gem to test your code at scale.

Honeybadger sponsor

rdom: An Experiment in Server-Side Reactive DOM Updates — Just a proof of concept for now, with the author admitting “there’s a memory leak in s.rb, which I’m not really sure how to solve.” Nonetheless, experiments like this have a way of turning into tomorrow’s reality..

Andreas Alin

MagmaChat: A Rails 7-based ChatGPT Bot Platform

MagmaLabs

Jobs

Senior Backend Engineer (Remote - EMEA) — Booqable prides itself on being a global company with team members working together from across the world. We are remote-first, so you can join us from wherever you are.
Booqable

Find Ruby Jobs with Hired — Hired makes job hunting easy-instead of chasing recruiters, companies approach you with salary details up front. Create a free profile now.
Hired

💡 An improvement to last week's tip?

Last week we included a handy tip for using Caddy and mkcert to locally use 'fake' domains of your choice for development purposes. The tip works well, but reader Gamaliel Toro wrote in to point out that Caddy now has this feature built in and you might find it an easier approach.

He's written up the technique in this gist – I struggled to make it work on my first attempt, but this is a last minute addition to the newsletter and the feature does indeed appear to be offered by Caddy. If all else fails, though, the tip in last week's issue still works 😉