I recently heard of a Rails 7 config option called config.active_record.query_log_tags_enabled. The feature adds comments to the SQL queries that Rails generates, like this: /*action='index',application='MyApp',controller='myrecords'*/ SELECT "myrecords".* FROM "myrecords" WHERE … | Continue reading
Imagine having a pairing buddy to help you with those finicky Pull Request (PR) reviews. During reviews, when it comes to refining small code snippets, Large Language Models (LLM) using Artificial Intelligence (AI) is my new friend and pairing buddy. Using AI, developers can quic … | Continue reading
Rails 7 introduced invert_where. This method inverts all scope conditions that it’s applied to, simplifying the process of defining the opposite of a where clause in ActiveRecord queries. It also comes with a few caveats that should be considered before using it. What is invert_w … | Continue reading
Recently, I had to implement a multi-screen slide deck presentation system that stayed in sync with the presenter’s view. How did I get there? Requirements Render three views: the group view, the individual view, and the presenter view. The group view should show a fullscreen vie … | Continue reading
This blog post provides information about accessibility laws and regulations, but is not legal advice. You should consult a lawyer for advice on specific legal issues or questions. If you do business in the UK, chances are high that you know about the Equality Act 2010 and Public … | Continue reading
The other day I was going through my old laptops (I have a collection of them 😅) and had one idea: What if I could run Ollama on one of them and access it remotely from my main machine? Could that mean that I am effectively hosting an AI model on my old laptop, for free? … | Continue reading
Welcome to another edition of This Week in #dev, a series of posts where we bring some of our most interesting Slack conversations to the public. URL-Safe serialization for any Ruby object Matheus Richard shares a gem called Universal ID that can serialize any Ruby object into a … | Continue reading
Our podcasts, Giant Robots Smashing into other Giant Robots and The Bike Shed are now available on YouTube podcasts and YouTube Music. We’ve imported the entire back catalog of episodes for both podcasts. The Giant Robots podcast has been going for 11 years and 575 episodes, with … | Continue reading
Maybe you trust your db/seeds.rb file to be idempotent when you run bin/rails db:seed, and maybe you don’t, but either way, you should test it so you can be sure that it does what you think it does. Doing so is simple! Let’s run through the process. Here’s a sample seed file: We … | Continue reading
For the past 5 ½ years or so, I live in the South of Spain. At first, I called Almería my home but in 2024 I moved to the outskirts of Granada. That move not only brought some green nature into my life (Almería holds the only desert in Europe – check out Tabernas if you are inter … | Continue reading
Over the years, I’ve accumulated a set of three principles that help me write code that’s more modular, readable, and modifiable. I apply them when writing new code to try to make things easier for my colleagues, and I use them when refactoring existing code that’s gotten too com … | Continue reading
This post is part of the Zero-downtime with Rails credentials series. In the first post we talked about the reasons that moved us towards making a codewide change and adopt Rails credentials rather than using environment variables to manage our secrets. In the second post we saw … | Continue reading
Many growing companies are vulnerable to changing market conditions and face pressure to evolve quickly. Having strong financial foundations and a strategic product roadmap are important to help your team meet growth goals. Combining the expertise of 5th Line and thoughtbot, we’v … | Continue reading
While others move away from DEI initiatives, we want to once again stress our steadfast commitment to working to increase diversity, equity, and inclusion within the company and beyond. Others have recently shown their willingness to compromise on those values. We will not. We be … | Continue reading
We’re heading to SXSW 2025, and if you’re passionate about product development, the future of tech, and how AI comes in the mix, we’d love to connect! We’ve long had a presence in Austin, Texas, as part of the community of tech leaders and startup founders at Capital Factory and … | Continue reading
It will soon be North West Ruby User Group (NWRUG)’s February 2025 meet-up on Thursday, 20 February, at Colony, One Silk Street. To attend, please secure a spot on their Ticket Tailor page. This month they are doing lightning talks! That means you have an opportunity to give a sh … | Continue reading
Chad Pytel, thoughtbot CEO, had the pleasure of joining Steven Wardell on his Digital Health Investor Talk series where they discussed the problem areas in healthcare that are amenable to the capabilities of generative AI. AI is everywhere, and the sector is white hot for investo … | Continue reading
Rails’ URL helpers allow you to pass in an Active Record object and it will automatically infer the proper URL including the id (e.g. link_to "Profile", @user). How can we get this behavior for custom objects? Custom objects Consider a custom Image class. We want URLs to look lik … | Continue reading
As co-host of the Bikeshed podcast, I put out a new podcast every week. I’m also a regular speaker at conferences, and a prolific author on this blog. How do I keep coming up with fresh ideas of things to write or speak about? It’s partly because I have an introspective approach … | Continue reading
I like to maximize my growth by being more mindful and writing down some thoughts and takeaways. This is especially true when I have completed a project that involved a technology, pattern, or skill that was new to me. But my thoughts are rarely clear enough to just write down cl … | Continue reading
Refactoring is a wonderful practice for making code and change easier to manage. That said, here are some reasons why we should not proceed with a refactor. 1. The change is not really a refactor Many people use the word “refactoring” incorrectly. If we’re embarking on a change t … | Continue reading
Ready to lead the way in your organization by implementing AI in an ethical and impactful way? Hundreds of you joined us last year to learn the strategic and technical foundations of getting started with AI. We’re excited to announce we’re back with more sessions of AI in Focus, … | Continue reading
Welcome to another edition of This Week in #dev, a series of posts where we bring some of our most interesting Slack conversations to the public. Regular Expression Denial of Service (ReDoS) Fer Perales learned about ReDoS (Regular Expression Denial of Service): a type of securit … | Continue reading
No one likes slow and brittle tests, in particular if you’re working a TDD workflow. Often, tests get that way because they’re doing too much. Consider avoiding the following: Using a database Database access imposes many costs on your tests. You need to setup a database, connect … | Continue reading
In this tutorial, we’ll learn how to build a fully animated drawer component without using any JavaScript. Then, to increase its fidelity, we’ll leverage Hotwire. Feel free to follow along below, or view the final code which lives in our Hotwire Example Template. Create a faux dr … | Continue reading
When you spend hours working on something, you naturally get better at it. This is a form of passive growth. Not every project you work on will be ground-breaking, or use the shiniest new tech. Does that mean you have to code on the weekends to keep growing as a developer? No, it … | Continue reading
The Noisy Animals code kata is a programming exercise designed to teach principles of improving bad code. The exercise consists of: around one page of bad code that generates animal noises (dogs go “woof”, cats go “meow”, etc) tests that verify the behaviour of the code for every … | Continue reading
With a landscape founded by people whose purpose is to continuously push boundaries and move forward, it’s never a dull year in the realms of Product Management. As we step into 2025, expect change, driven by technological advancements, shifting consumer expectations, and new mar … | Continue reading
Sometimes it catches me off guard to remember that not everyone I might encounter works with or even knows anything about Ruby on Rails. I’ve had years of front-row experience with Rails that allow me insight into the fulfilling and productive work it enables. When encountering s … | Continue reading
In a 2017 post German Velasco wrote about how to think and do refactoring right. This is a follow-up post about what goes wrong when we misuse refactoring and (in German’s words) “rob ourselves of the power to communicate an important concept”. Done well, refactoring is a low-ris … | Continue reading
I was browsing an online marketplace the other day because I was a bit bored, and because I have a unique need to seek out dark patterns. Something caught my eye as I scrolled. Amongst all the other suspiciously cheap items, was a bag for a chicken. Not a bag with a chicken patte … | Continue reading
Rails is able to automaticaly infer which HTTP verb to use when generating forms for Active Record models in form_with. How can we get the same for our plain old Ruby objects? Problem We want to avoid having to explicitly specify the method when rendering a form for our custom Ca … | Continue reading
Integration simply isn’t enough I’m thrilled to announce the release of Superglue 1.0. First announced a year ago, Superglue is a library designed to make building interactive Rails and React apps as productive as the classic Rails stack. In every client project we’ve used it on, … | Continue reading