The Ruby on Rails Podcast 🔗
I co-hosted episode 488 of The Ruby on Rails Podcast. Brittany and I talked with Allison McMillan and Chelsea Kaufman about all the plans for RubyConf 2023.
All the thanks to Brittany Martin for asking me to join. I didn’t have podcast hosting on my career bingo card.
Base62 Decoding Short Codes
[Akitando] #145 - 16 Linguagens em 16 Dias: Minha Saga da Rinha de Backend
A Rinha de Backend que aconteceu em Agosto de 2023 foi muito divertida. Eu só fiquei sabendo quando acabou, mas não quer dizer que não pude me divertir. Hoje quero resumir tudo que eu fiz nos 16 dias seguintes do evento, detalhes sobre os projetos dos participantes, a controvérsia do Ranking de Linguagens, quais os truques por trás dos vencedores, e como você também poderia ser um vencedor!
Finalmente vou demonstrar o que significa "ser promíscuo" com linguagens de programação. Vamos entender porque como de fato ler um ranking. E como podemos fazer TODO MUNDO alcançar o primeiro lugar do Rust!
Conteúdo
- 00:00:00 - Intro
- 00:01:41 - CAP 01 - As Regras - Requerimentos da Rinha
- 00:09:46 -…
If you are using the i18n gem with Ruby 3.0 or are planning to upgrade Ruby to 3.0 while using the i18n
gem, this blog post will cover a gotcha that can be tricky to understand.
The problem
Suppose you are using the i18n
gem in an application and the code has some logic depending on Ruby’s frozen?
method, then you would see totally different behavior in Ruby 2.7 and in Ruby 3.0.
Take a look at this code snippet when run in Ruby 2.7
# Ruby 2.7
a = I18n.t("user.title")
a.frozen?
=> false
b = a.clone
b.frozen?
=> false
Here the translated result stored in variable a
is not frozen. And when we clone
the object a
, the cloned object is also not frozen.
Now let’s take a look at the same…
Breaking Down the GraphQL Monolith and Automating Developer Workflows through Rails Generators
At Gusto, there has been a big push to think about modularization at every step of the development process. Whether it’s driving features in the monolith through the use of packwerk, or adopting yarn workspaces in our front-end code, modularization has been a key initiative to help scale feature development at Gusto.
The decision to adopt GraphQL as the communication protocol between the frontend and backend was made in order to harness its inherent advantages. GraphQL offers a significant degree of freedom and flexibility, enabling developers to craft requests tailored to specific client use cases, ultimately enhancing the efficiency and precision of…
Episode 488: Rubyconf 2023 Preview with Allison McMillan and Chelsea Kaufman
Special co-host Kevin Murphy joined Brittany this week to interview Allison McMillan and Chelsea Kaufman, co-chairs of the upcoming Rubyconf 2023 happening in San Diego. The quartet discussed lessons learned from Railsconf 2023, the approach to thinking about and planning this year's Rubyconf and what is new and different at the event.
Show Notes:
- Buy Tickets to Rubyconf 2023
- Ruby Central
- Allison McMillan's website
- Chelsea Kaufman on LinkedIn
- Kevin Murphy's website
Sponsored By:
If you want to simplify your stack, and lower your bills, it’s time to check out Honeybager. Honeybadger combines all of those services into one easy to use platform—it’s everything you…
Deploying a Rails app with Kamal
This is an updated version of the post I wrote about MRKS in the past.
Sidekiq allows Ruby developers to maintain fast and responsive web applications by moving time-consuming tasks into the background.
With multithreading at its core, Sidekiq can process many jobs at once. This makes Sidekiq an important part of Ruby or Rails applications that handle heavy loads or perform tasks like sending emails or processing files. Without background processing, long-running tasks would block your application's main thread, resulting in slow response times and a poor user experience.
In this post, we'll focus on effectively utilizing Sidekiq to manage and process background jobs.
Let's get started!
The Basics of Sidekiq
In essence, Sidekiq is a full-featured background…
Base62 Encoding Short Codes
A Fresh Look for the Features Roadmap
August 2023 RubyGems Updates
Welcome to the RubyGems monthly update! As part of our efforts at Ruby Central, we publish a recap of the work that we’ve done the previous month. Read on to find out what updates were made to RubyGems and RubyGems.org in August.
RubyGems News
This month in RubyGems, we released 3.4.18, 3.4.19 and Bundler 2.4.18, 2.4.19.
In RubyGems, we improved the documentation performance by speeding up the build process when updating RubyGems - #6864. We added a poller to fetch WebAuthn OTPs - #6774, added a file
option to the Ruby method in the Gemfile - #6876 and removed some side effects when unmarshalling old Gem::Specifications
- #6825.
Some other improvements that landed into our repo this…
We’ve likely heard this advice throughout our lives: listen more than you talk. In a world of social media, influencers, and seemingly constant opinions and arguing, listening gets put on the back burner, and the focus is all about talk.
That can be especially true for recruitment, a career where conversing with people is often viewed as the central theme. It’s a bit of a stereotype, but recruiters can be notorious at tech and software engineering events for being the loudest people in the room—pushing conversations on others without noticing how the people they’re speaking with are uninterested in what they’re trying to say. Ever pushing, needing to talk, talk, talk. This sales-y…
Creating The Link Model
402: Musings on Mentorship
Joël describes an old-school object orientation exercise that involves circling nouns in a business problem description. The purpose is determining which nouns could become entities or objects in a system. Stephanie shares she's working from the Hudson Valley in New York as a trial run for potentially relocating there. She enjoys the rail trails for biking and contrasts it with urban biking in Chicago.
The conversation between Joël and Stephanie revolves around mentorship, both one-on-one and within a group setting. They introduce a new initiative at thoughbot where team members pair up with principal developers for weekly sessions, emphasizing sharing perspectives and experiences.
…Ruby Central is a non-profit organization dedicated to support and advocacy of the worldwide Ruby community.
We produce the annual RubyConf and RailsConf conferences, support community growth, and provide vital infrastructure for the Ruby programming language by maintaining the bundler and rubygems packaging services in addition to other open source projects.
The board of directors for Ruby Central act as representatives to the community and work to ensure smooth operations today and smart strategy for tomorrow. We meet once a month and all take turns working as co-chairs of the conferences.
To support our conferences and programs, we're looking to fill multiple board seats! We'd love to have…
One of the primary goals of the Rails Foundation is to improve the Rails documentation for both new and existing users. We have a lot of ideas about how to achieve this, and we are now ready to start tackling this with the help of an experienced UX designer and a technical writer (or two) with a strong Rails background.
These two roles will have a lot of opportunity for cross-collaboration to find (and close) gaps in the current content. Both roles will also work closely with members of the Rails Core and Issues team as well as volunteers from the Rails community to understand the needs and pain points of Rails users.
Here are some of the projects that you could be working on:
- Updating…
In Rails 7.1, an enhancement has been introduced toActiveRecord::Batches
methods, related to models with composite primary keys. This update allowsdevelopers to specify ascending or descending order for each key within acomposite primary key.
Before Rails 7.1
In Rails versions prior to 7.1, when batch processing records with a compositeprimary key, like id_1
and id_2
, developers could use the :asc
or :desc
argument to control the sorting order. However, there was a limitation in howthis sorting worked. When you specified the sorting order using :asc
or:desc
, it affected both id_1
and id_2
simultaneously. In other words, ifyou requested ascending order, both id_1
and id_2
would be sorted…
URL Shortener Requirements
In defense of consensus
There’s a style of reactionary meme that takes a photo of like, empty store-shelves or a trash-strewn street, and applies the image macro “This is what Communism looks like”. But upon closer inspection (and social media lampooning), it’s a photo of America, capitalist America, very much not under communism. We’ll come back to this.
Let’s talk about “consensus”. Not a week goes by in my Bay Area tech worklife where I don’t read or hear someone dragging consensus. Consensus is pilloried: weak, indecisive, lowest-common denominator, unclear, drawn out… consensus is bad, they say.
Working in tech for a decade, I have to admit this struck me as strange the first time I heard a coworker…
Sinatra is a lightweight web application framework written in Ruby. It provides a simple and easy-to-use syntax for building web applications. The framework focuses on being minimalistic, allowing developers to quickly create web applications without having to deal with a lot of the boilerplate code and relatively rigid way of doing things that accompany larger and more popular frameworks like Rails.
In this article, we'll use the Sinatra framework to build a simple URL-shortening app where a user can input a long URL and generate a short URL that redirects to the original URL when clicked. The app will also have a feature for keeping track of how many times a shortened URL is clicked.
Ta…
pry-byebug
gem. Since then, I've switched to the debug
gem for all my Ruby debugging needs, and hence re-publishing the updated post.
Reading the source code is a great way to understand how a feature works in Rails. However, stepping through the specific Rails method you're interested in is even better. You can inspect the local variables, follow the conditional path, and learn exactly what's happening behind the scenes.
This post shows how you can debug and step-through the Rails codebase for a better understanding of the framework.
Recently, while researching the authenticity tokens in Rails, I wanted to learn how…
Conference Talk Preparation Series 🔗
- Sharing Past Conference Proposals
- Building Conference Talk Content
Have you recently had a conference proposal accepted? Congratulations! Are you wondering, “what do I do now?” Here is the process I follow to turn my proposal into a full-length talk.
Content Generation 🔗
My first step is to gather all the content I want to talk about as quickly as possible. I know that sounds reductive. Oh, the first step is JUST to put together all your content? How easy! I might as well tell you how to draw an owl next.
But, here’s the thing - for a conference talk, I’m not starting from scratch. I’ve already put a lot of time, and thinking, into the proposal. For me, that…
Welcome to Once a Maintainer, where each week we interview an open source maintainer and tell their story.
This week we’re talking to Felienne Hermans, professor of computer science at the Vrije Universiteit Amsterdam and creator of Hedy, a progressive programming language designed for kids 10 and up and for teachers to use in the classroom.
Once a Maintainer is written by the team at Infield, an app that helps engineering teams manage complex open source dependency upgrades. We spoke with Felienne from her home in the Netherlands.
How did you become a programmer?
Probably when I was about six, we had a computer in the house. Immediately I enjoyed playing with the computer, making the…
Hi, it’s Greg, bring you the latest changes in the Rails codebase.
Rails 7.1 beta release
The first beta version of Rails 7.1 has been released! There have been over five thousand commits made by over 800 contributors since Rails 7.0, so this release is packed with new features and improvements. You can read a summary of the changes in the announcement.
Ignore env files (except templates)
To prevent accidentally leaking secrets to code repositories, the default .gitignore file excludes .env(except template ones) files from now on.
Explicit primary_key: option should always take priority in associations
This pull request fixes the issue where the primary_key:
option was ignored if the…
There's A TypeScript In My Boot!
On today’s episode, Jason, Chris, and Andrew start off with a captivating discussion that starts with bleeping offensive content, reminiscing about the era of Walkman’s, and hearing about Andrew’s absence from social media. The conversation then shifts to the announcement of the removal of TypeScript and exploring the challenges and community dynamics surrounding it. The guys share their experiences with TypeScript, communication challenges in open source projects, and the importance of maintaining a positive and respectful community. Additionally, they touch on recent announcements related to software source code and a humorous incident involving law enforcement. They also have…
New app with Rails 7.1.beta1
Here is how to create a new Rails app that runs on Rails 7.1 beta1
gem install -v 7.1.0.beta1 rails
rails _7.1.0.beta1_ new myrails71app
Replace myrails71app
with your own app name and you are good to go.
This will generate a Gemfile
that has something like this inside and then install required gems for Rails 7.1.0.beta1
# Gemfile
gem "rails", "~> 7.1.0.beta1"
New app with Rails main branch
Here is how to create a new Rails app that runs on Rails main branch from GitHub:
rails new myrailsapp --main
This will generate a Gemfile
that has something like this inside:
gem "rails", github: "rails/rails", branch: "main"
May you have a lot of ideas to try!
Enjoye…
Hello! I was talking to a friend about how git works today, and we got onto the
topic – where does git store your files? We know that it’s in your .git
directory, but where exactly in there are all the versions of your old files?
For example, this blog is in a git repository, and it contains a file called
content/post/2019-06-28-brag-doc.markdown
. Where is that in my .git
folder?
And where are the old versions of that file? Let’s investigate by writing some
very short Python programs.
git stores files in .git/objects
Every previous version of every file in your repository is in .git/objects
.
For example, for this blog, .git/objects
contains 2700 files.
$ find .git/objects/ -type f |…
A Ruby 3.3 preview and Rails 7.1 beta
#669 — September 14, 2023
Ruby Weekly

Ruby 3.3 Preview 2 Released — With Christmas Day as the traditional day that new versions of Ruby land, things begin to pick up in the fall. Major performance improvements over 3.2 are already on offer thanks to ongoing improvements with YJIT, but there’s also an optional experimental pure-Ruby JIT compiler called RJIT to try.
Yui Naruse
'We Turned Lobste.rs into a Benchmark for YJIT' — Related to my comments (above) on how YJIT is continuing to get faster and faster, Noah Gibbs has some real world data on just how well YJIT, the default JIT in…
Object#with(**args)
method is not part of the Ruby standard library. Thanks to Rails, it’s a convenience method added to the Object
class to manage object states.
def test_posts_when_user_is_verified
user.with(verified: true) do
# Perform posts testing
end
end
Before
Saving the value of an attribute, setting a new value, and then restoring the previous value in an ensure clause is a fairly popular pattern in Ruby, particularly in testing or in api calls
def test_posts_when_user_is_verified
old_value = user.verified
user.verified = true
# Perform posts testing
ensure
user.verified = old_value
end
This is a common and popular pattern as everything works fine in…
Please help us welcome BigBinary as the newest Contributing member of the Rails Foundation!
For more than twelve years, BigBinary has built custom web applications for clients using Ruby on Rails. Recently, they also launched neeto, an impressive suite of productivity tools all built on Rails. Over the past decade, the team has made many contributions to the Rails codebase and is active in the Rails community- organizing meet-ups, sponsoring events like Rails Girls, and speaking at various Ruby and Rails conferences around the world.
At BigBinary, we all love working with Ruby on Rails, and find it incredibly productive. Without it, it wouldn’t be possible for us to build neeto,…
Ruby 3.3.0-preview2 Released
We are pleased to announce the release of Ruby 3.3.0-preview2. Ruby 3.3 adds a new pure-Ruby JIT compiler named RJIT, uses Lrama as a parser generator, and many performance improvements especially YJIT.
RJIT
- Introduced a pure-Ruby JIT compiler RJIT and replaced MJIT.
- RJIT supports only x86_64 architecture on Unix platforms.
- Unlike MJIT, it doesn’t require a C compiler at runtime.
- RJIT exists only for experimental purposes.
- You should keep using YJIT in production.
- If you are interested in developing JIT for Ruby, please check out k0kubun’s presentation on Day 3 of RubyKaigi.
Use Lrama instead of Bison
- Replace Bison with Lrama LALR…
In addition to Rails, they use Hotwire (Turbo + Stimulus) and TailwindCSS, which in my opinion is the best tech stack to build web applications in 2023. Check out their job opening for the Full-stack Rails Engineer role. It's remote (only in the US), and if you think you’re a suitable candidate, get in touch with Justin.

You must have seen those cookie banners on most websites nowadays. Ever wondered what cookies are and why websites use them?
In this chapter, we're going to learn almost everything you need to know about…
How To Set Your 2024 Product Strategy
If you’re wondering how to make sense of all these frameworks, you’ve come to the right podcast. In this episode, the Rogues dive DEEP into the pros and cons of Stimulus, Hotwire, Turbo, React, Rails, and more; why certain communities are divided amongst each other (and how to fix it); and what tools you NEED to try in 2022.
In This Episode
This tendency in the Rails community that reveals why users are slow to try Hotwire
What Charles learned from comparing React vs. Stimulus at his old job (and how Rails came to the rescue)
Why those in the Java community are seeing React as a “blackhole that’s sucking up everything” (and why some of the Rogues disagree)
Up and coming frameworks that you…
Episode 487: Building the Rails World Application with Shami Tomita and Eric Halverson
Rails World needed a website! Did you want to be on the small team that helps build it? Shami Tomita and Eric Halverson certainly did and so they came on to the show to talk about their experience and the tech stack behind the conferencing app. Backed by Daniel Rassiner and Cody Norman, the crew talked about supporting Juniors and conference tips.
Show Notes:
- Rails World
- CasaVolunteerTracking.org
- The Agency of Learning
- Eric Halverson (@elhalvers) / Twitter
- Eric on Github
- Eric on LinkedIn
- Shami (@Shami941) / Twitter
- Shami on Github
- Shami on LinkedIn
- Daniel on Github
- Daniel on LinkedIn
- Cody's Personal Site
Sponsored By:
If you want to simplify your stack, and lower…
Six ways to prevent a monkey-patch drift from the original code
Monkey-patching in short is modifying external code, whose source we don’t directly control, to fit our specific purpose in the project. When modernising framework stack in “legacy” projects this is often a necessity when an upgrade of a dependency is not yet possible or would involve moving too many blocks at once.
It’s a short-term solution to move things forward. The reward we get from monkey-patching is instant. The code is changed without asking for anyone’s permission and without much extra work that a dependency fork would involve.
But it comes with a hefty price of being very brittle. We absolutely cannot expect that…
Continuing with my endeavour of publishing more about using GPT-4 while coding, here I am going to show you how I refactored some HTML when writing the homepage for ShortRuby.com
Note: When I am writing in this text GPT-4 I want to say that I am using Cursor IDE with GPT-4 option.
First, this is the result. I am pretty happy with it as I spent little time making it and it was a small iteration. This will probably evolve over the next weeks thus it is better to capture here how it looks like at the end of this coding session:
Adding the logo to the top left
After I created a very simple hero section that contained the title and a description I wanted to add a logo to the left side.
The…
Rails 7.1 Beta 1: Dockerfiles, BYO Authentication, More Async Queries, and more!
Rails World is fast approaching and we’re gearing up to celebrate the 20th anniversary of Rails in style with the first beta release of Rails 7.1! There has been over five thousand commits made by over 800 contributors since Rails 7.0, so this release is packed with new features and improvements.
Please help us test all this new stuff, so we can ensure a solid final release of Rails 7.1 for the birthday party 🎉
Dockerfiles for new applications
Rails will now generate all the Dockerfiles you need to deploy your application using Kamal, or any other Docker-based deployment setup, when you run rails new
. These Dockerfiles are tuned for production use with proper caching layers, multi-stage…
Sqlite & Rails in Production
When deploying a Rails application to production, its rare to question the idea of running a Postgres or MySQL database to persist data and Redis for caching, background job processing, and WebSockets, but what if it could all be done without running these services?
“No part is the best part”, right? Here’s the thing, Redis and Postgres run as separate processes that need to be monitored. Usually these processes are running on a separate server that’s accessed over a network connection, which can also break. You’ll either have to deal with that complexity yourself or pay to have it managed with services like Upstash Redis.
What if we could run everything on one server and not have to…
Exploring Ruby Warnings
We are used to checking the deprecation warnings displayed by Rails or warnings from different gems, but Ruby itself can also display warnings to help us find code that can be problematic.
In this article we will explore how to use them, how to analyze them, and some examples of interesting warnings that can be really helpful during upgrades.
Enabling Ruby Warnings
Warning Options
The ruby
command accepts the -w
and -W
arguments that will enable the highest level of verbosity for warnings.
Verbosity Levels
The -W
argument also accepts a verbosity level value:
-
-W0
means warnings are completely disabled by setting$VERBOSE = nil
-
-W1
means important warnings are displayed by…
Tech has a well-known, oft-mentioned problem: the barrier to entry is an enormous, looming, and often confusing challenge. This problem has only expanded in our current economic climate. The internet is riddled with how-to courses from self-appointed LinkedIn influencers— promising to show you all the tips and tricks for only $250, with titles like “How to break into tech: a guide for career changers”*. Twitter (or are we calling it X now?) is full of opinions on what job seekers “should” be doing, with a particular focus on entry-level, career-changing engineers.
*I made this title up
If someone read all of these opinions, they would likely be overwhelmed. These so-called experts…
Caching is an effective way to speed up the performance of Rails applications. However, the costs of an in-memory cache database could become significant for larger-scale projects. In this blog post, I’ll describe optimizing the Rails caching mechanism using the Brotli compression algorithm instead of the default Gzip. I’ll also discuss a more advanced technique of using in-memory cache for extreme performance bottlenecks.
Brotli vs Gzip 101
In one of my previous posts, I’ve covered how Rails leverages compression algorithms for the HTTP transport layer. Please check it out for more details on how Gzip and Brotli differ in compression ratios and performance. Here, let’s quickly recap the…
You can use…
Ruby goes to the movie theater: directing the refactoring of your application
This post introduces a method I use to refactor big applications. I want the process to happen in a predictable manner and make sure that important things are addressed before others. One day I realized that there is a missing tool in my workflow, so I’ll introduce my new gem called rubocop_director.
Refactoring as a process
Refactoring is a technique of transforming the code without making changes in its functionality. Why people do that?
Sometimes the way that code written makes it harder for to engineers to improve the performance or add a new feature. Another example is a scenario when application is big and there are many ways to do the same thing or same responsibility is…
401: Making the Right Thing Easy
Stephanie has another debugging mystery to share. Earlier this year, Joël mentioned that he was experimenting with a bookmark manager to keep track of helpful and interesting articles. He's happy to report that it's working very well for him!
Together, they discuss tactics to ensure the easiest route also upholds app health and aids fellow developers. They explore streamlining test fixes over mere re-runs and how to motivate desired actions across teams and individuals.
Transcript:
JOËL: Hello and welcome to another episode of The Bike Shed, a weekly podcast from your friends at thoughtbot about developing great software. I'm Joël…
Gold Miner is an app I created to transform interesting conversations we have at thoughtbot into blog posts. The articles generated are part of the This week in #dev series, and today I’ll talk about some of the technical details of the app, like how we use artificial intelligence, async Ruby, and other interesting patterns.
The code examples were simplified a little, but you can always read the real thing because it’s open-sourced.
The MVP
The first step was to classify what I thought were “interesting messages”. We share a lot on our public Slack channels, so I decided to search messages containing “tip” or “TIL” in them. To allow people to hand-pick…

Essential techniques to ensure your HTTP clients are robust and configured to avoid pitfalls and insights on the benefits of separating the client code layer from the app. This guide isn't limited to backend apps (although most examples are in Ruby), the same principles work for any language and platform, even frontend.
Welcome, digital explorer, to the vast terrain of microservices. Whether you're navigating these challenging lands on your own, or comfortably residing in the serenity of a monolithic architecture, an HTTP client is an…
Ruby HTTP Server from scratch
JRuby 9.3.11.0 Released
The JRuby community is pleased to announce the release of JRuby 9.3.11.0
- Homepage: https://www.jruby.org/
- Download: https://www.jruby.org/download
JRuby 9.3.x is compatible with Ruby 2.6.x and stays in sync with C Ruby. As always there is a mix of miscellaneous fixes so be sure to read the issue list below.
Thank you to our contributors this release, you help keep JRuby moving forward! @ahorek, @chadlwilson, @justinstoller, @k77ch7, @kares, @snoglobe
Ruby Compatibility
Standard Library
The Exchangeable Image File Format (EXIF) is a standard that specifies formats for images and sounds. It stores technical details through metadata, data that describes other data, such as the camera make and model and the date and time the image was taken.
Initially, EXIF was used for two image formats, JPEG and TIFF. But today, other file formats such as PNG, WEBP, or HEIC also support EXIF for metadata.
This article will focus on the JPEG format. In the first part, we will explore its structure before seeing how to read and update associated metadata through Javascript in a browser environment.
Before moving on, it is essential to review some key concepts:
📌 What is the 0x
notation?
0x
…
Ruby, in contrast to other languages, often provides multiple ways to accomplish simple programming tasks. In pursuit of developer happiness, the Standard Library offers the opportunity to make your code appear more like English.
In this case we’ll look at comparing numbers with zero.
Instead of…
…using comparison operators:
if number > 0
# do a thing
end
if number < 0
# do a thing
end
Use…
…Ruby’s convenience methods on Numeric
, and its subclasses, to express yourself more clearly:
if number.positive?
# do a thing
end
if number.negative?
# do a thing
end
Why?
I’ve discussed my preference for a similar comparator, zero?
, in a previous article.
The “more English”…
Rails 7.0.8 has been released
Hi everyone,
I am happy to announce that Rails 7.0.8 has been released.
CHANGES since 7.0.7
To see a summary of changes, please read the release on GitHub:
7.0.8 CHANGELOG To view the changes for each gem, please read the changelogs on GitHub:
- Action Cable CHANGELOG
- Action Mailbox CHANGELOG
- Action Mailer CHANGELOG
- Action Pack CHANGELOG
- Action Text CHANGELOG
- Action View CHANGELOG
- Active Job CHANGELOG
- Active Model CHANGELOG
- Active Record CHANGELOG
- Active Storage CHANGELOG
- Active Support CHANGELOG
- Railties CHANGELOG
Full listing
To see the full list of changes, check out all the commits on GitHub.
SHA-256
If you’d like to verify that your gem is the same as…

Most web applications have some functionality that's common for many (or even all) HTTP requests. For example, an application will authenticate the user and log the incoming HTTP request, add new headers, or check if the request is for a static file and serve it from a CDN without hitting the app server.
Middleware is an elegant way to organize this common functionality, instead of spreading it everywhere in…
Infer primary_key: :id on associations with composite primary key models, add validation option for enum and more!
Hi! This is Vipul bringing you the latest from this week’s changes in the Rails codebase.
Infer primary_key: :id on associations with composite primary key models
Prior to this change, you’d need to do the following to set up associations for composite primary key models:
class Order
self.primary_key = [:shop_id, :id]
has_many :order_agreements, primary_key: :id
end
class OrderAgreement
belongs_to :order, primary_key: :id
end
After this change, the primary_key
option no longer needs to be specified:
class Order
self.primary_key = [:shop_id, :id]
has_many :order_agreements
end
class OrderAgreement
belongs_to :order
end

ICYMI our head of open source André Arko was featured on the Rooftop Ruby Podcast last week! He covered his journey to Bundler, how Ruby Together came to be and how he is continuing this work with Ruby Central. He also shared some developer horror stories – and funny stories too! Enjoy, and please don't hesitate to reach out and let us know what you think.
Path of my learning path about how to use AI/LLMs to augment my developer productivity I started using www.cursor.so
Here let me show you how I made two changes to the rubyandrails.info website.
Replacing a form with a Phlex component
The first task that I asked was about replacing an HTML with a component. To achieve this in Cursor (MacOS edition) you have to select the text and then press CMD+K. Then a pop-up will appear where you can ask your question (or write your prompt) like this:
After submitting Cursor (that uses GPT4 in this case under the hood) will make a diff for the selected code and ask you to accept it or not:
I like this idea that it proposed a diff because I can review…
Sorry For Slandering Yet Another Gem
In this episode of Remote Ruby, Jason and Andrew cover a wide range of topics that start out with nothing to do with tech. First, they discuss energy drink flavors and then transition into a humorous exploration of disagreements with Chris, who happens to not be here today. They cover various topics including CMS options, front-end development, and Tailwind CSS customization. They also introduce a gem called “Counter” created by their colleague Jamie, aka “Dad” at Podia, which efficiently handles attribute tracking. Jason and Andrew discuss the gem’s features and flexibility, highlighting its value in addressing complex counting challenges. We end with a discussion on email…
We’ve finally launched Smily (formerly BookingSync) Engineering Blog which I’m going to primarily focus on instead of this blog here. If you enjoyed the content of my personal blog, make sure to check Smily blog as it’s going to be even better!
DHH says goodbye to TypeScript
#668 — September 7, 2023
Normal service has been restored – I'm back from my summer vacation 😅 If you haven't had an issue of Ruby Weekly for a few weeks, it's my fault, not yours, but we're now back all the way through till Christmas.. hopefully. There's a lot to catch up on, so let's go.
__
Peter Cooper, your editor
Ruby Weekly

Ruby Outperforms C: Breaking the Catch-22 — YJIT’s ability to improve performance by adapting to run-time behavior can increase the speed of our code in a way that dropping down to C can’t, demonstrates Aaron. This should encourage us to write as much pure Ruby as possible…
I'm a teapot
Greg Molnar is a Ruby Developer and OSCP Penetration Tester. He joins the show to talk about Penetration Testing. He begins by explaining what it is, how beneficial it can be to the users, its process of securing applications, the actual testing process, and many more!
- White box – consultant provided access to source code
- Grey box – the company gives info to the consultant
- Black box – nothing provided to the consultant
Sponsors
- Chuck's Resume Template
- Raygun - Application Monitoring For Web & Mobile Apps
- Become a Top 1% Dev with a Top End Devs Membership
Links
- Secure Code Review for Rails Developers
- Burp proxy
- Nikto
- Metasploit
- Beef framework
- Andrew Kane’s Rails Security
- spektr: static-code analyser…
Socials
- Greg Molnar
- LinkedIn: Greg Molnar
- Twitter: @gregmolnar
Picks
- Greg - Yubi…

If you haven't heard, Turbo 8 is dropping TypeScript.
I used to love TypeScript, but now I prefer plain JavaScript, both for reading and writing. So personally, I am happy with this bold move, even though everyone on the Internet seems to be pissed off.
Anyway, ever since switching to Hotwire two years ago, I've always wondered how Turbo really worked behind the scenes. For example, what really happens when you click the link, how frame-swapping works, etc. Reading the source is one of the best ways I've found to learn how a feature/framework/program works, so when I read David's comment on the PR,
The code not only reads much better, it's also freed of the type wrangling and gymnastics…
Welcome to Once a Maintainer, where each week we interview an open source maintainer and tell their story.
This week we’re talking to Marc-André Lafortune, a longtime contributor to the Ruby and Elixir communities, member of the Ruby and rubocop core teams including the core rubocop-ast engine, and creator of the backports gem.
Once a Maintainer is written by the team at Infield, an app that helps engineering teams manage their dependency upgrades. We spoke with Marc-André from Montreal.
How did you get into programming?
I was really, really young, beginning of the 80’s. My father always really liked new gadgets. I think we were one of the first people in Montreal to get rollerblades at the…
Community Day at RubyConf 2023 Highlights Connection, Collaboration & Mentorship
The New Format Allows for Long-term Partnerships & New #RubyFriends
Ruby Central, Inc. announced a completely reimagined format for RubyConf 2023. The 23rd annual Ruby Conference, taking place in San Diego, California, will kick off with Community Day, which is replacing one day of talks. Instead, registrants will attend workshops, collaborate with one another and take advantage of opportunities to meet open source maintainers, including the chance to pair with core teams; Ruby, JRuby, Truffle Ruby, Bundler/RubyGems and more.
“Many of us have #RubyFriends from conferences, but in our day-to-day work, we work in silos,” said Allison McMillan, Co-chair, RubyConf 2023 “This year we wanted to…
Episode 486: High Performance PostgreSQL for Rails with Andrew Atkinson
If you love taking about databases, this is the episode for you. Ahead of the launch of his new book, High Performance PostgreSQL for Rails, Andrew Atkinson joined the show with special guest co-host, Pat Bair, to talk about why he wrote a book, why he focused on PostgreSQL and his favorite feature from the upcoming 7.1 release.
Show Notes:
- Landing page and newsletter signup for the book “High Performance PostgreSQL for Rails”
- Andrew's Tweet Announcing Beta for the Book
- Andrew's Personal blog on Postgres/Rails/general topics
- Rideshare Rails API app used for book examples/exercises
- Pg_scripts repo
- Andrew’s Postgres and Rails presentations and podcast appearances on YouTube
- Andre…
Sponsored By:
You won’t know if Honeybadger will really save you time and trouble until you see how it works in your own toolchain. With two lines of code and five minutes, you can see for yourself. Honeybadger automatically hooks into popular web frameworks,…
Good code has a lot to do with how readable it is. As developers, we more often read code than write it. As my Perl teacher told us many times: the flexibility of Perl's syntax was its best and worst trait at the same time. Ruby's syntax was influenced partly by Perl and is also quite flexible.
Whatever language you pick, set some guidelines to avoid overusing a language's flexibility. Style guides for Ruby abound on the web, and it's not difficult to pick a style nowadays. But there is not much point in having copious debates on style and whether a proposed change follows a guide. Style enforcement is best left to a tool.
Such tools are called linters and static code analyzers. The de…
This week, I will show you how to rate-limit your authentication endpoints with Rack::Attack.
So many people are frustrated with recruiters, and why wouldn’t they be? Recruitment hasn’t changed a lot over the years. The tools have changed, but the principles of good recruitment vs. bad recruitment stay the same. And all of us have seen examples of bad recruitment.
In 2021, I received the following opportunity:

I have no forklift skills, nor have I ever been a forklifter.
If you’ve ever received a similarly mismatched message, you may have started wondering why LinkedIn even exists, why recruiters are so bad at their job, and why the spam filter on Gmail failed you.
Does recruitment have a fighting chance for a better, enlightened reputation? At…
400: How To Search
Joël shares he has been getting more into long-form reading. Stephanie talks about the challenges she faced in a new project that required integrating with another company's system.
Together, they delve into the importance of search techniques for developers, covering various approaches to finding information online.
- Domain Modeling Made Functional
- Episode on heuristics
- Episode on specialized vocabulary
- Episode on discrete math
- Joël’s discrete math talk at RailsConf
- Dash
- Alfred
- Indiana Jones and the Crypt of Cryptic Error Messages
- Browser History confessional by Kevin Murphy
Transcript:
STEPHANIE: Hello and welcome to another episode of The Bike Shed, a weekly podcast from…
When we work on Rails upgrades, most of the time we have to solve issues after updating the gems. These problems can go from simple and straightforward to really complex and hard to debug. Here we will discuss different skills and techniques that we use to complete the upgrade.
Basic things which you should always do
- Ask yourself and others simple or stupid questions. Try to make sure you know what you are fixing.
- Take a close look at an error log or stack trace.
- If you are not sure how or where to start, add debug breakpoints or
puts
statements in the code. This will help you understand the code workflow. - Write down your understanding or have a
Rubber duck conversation
. (The…
Lately I’ve been messing around with writing a GraphQL parser called TinyGQL. I wanted to see how fast I could make a GraphQL parser without writing any C extensions. I think I did pretty well, but I’ve learned some tricks for speeding up parsers and I want to share them.
Today we’re going to specifically look at the lexing part of parsing.
Lexing is just breaking down an input string in to a series of tokens.
It’s the parser’s job to interpret those tokens.
My favorite tool for tokenizing documents in Ruby is StringScanner
.
Today we’re going to look at a few tricks for speeding up StringScanner
based lexers.
We’ll start with a very simple GraphQL lexer and apply a few tricks to speed it…
A very basic lexer
He…
Server-sent events
- The paths not taken
- Server-sent events
- An on-page buffer of next articles
- What’s actually happening at this point
- A demo
- Smoothing out the rough edges
- Conclusion: outside-the-box lessons
In my last post, I rewrote a little Rails app with Roda and Turbo Streams. In this post I’ll show how I solved the app’s last and biggest problem: slow API calls. So slow that the user had to wait several seconds between pressing the “Next article” button, and actually seeing a new article.
The app is called Wiki Stumble. Here’s the live site and the GitHub repo. The app shows summaries of Wikipedia articles personalized to the user’s likes and dislikes.
Due to Wikipedia APIs not having…
The most underused pattern in Ruby
Recently one of the RailsEventStore users posted an issue that one wanted to use RES on a Postgres database with PostGIS extension. Migration generator used to setup tables for events and streams was failing with UnsupportedAdapter
error.
In RailsEventStore we supported to date PostgreSQL, MySQL2 and SQLite adapters representing given database engines. But if you want to make use of mentioned PostGIS extension, you need install additional activerecord-postgis-adapter
and set adapter: postgis
in database.yml
. Our code relied on value returned by:
ActiveRecord::Base.connection.adapter_name.downcase
=> "postgis"
I thought — Ok, that’s an easy fix, PostGIS…
System Tests
A Peek Behind the Curtain of Our New Open Source Page
We recently launched a new open-source page. While this blog post gives a good overview of why we chose to highlight particular content, we also faced some interesting technical challenges while building it.
Querying contributions with GraphQL
A lot of what occurs in the open-source world happens on GitHub, and thoughtbot is no exception. All our repositories are hosted there, so this was a natural place to start. We also wanted to highlight our team’s contributions to other open source projects in the community.
GitHub has a GraphQL API that allows us to query for all the information we need with a single request. We used the graphql-client gem to query the GitHub API. This…
This post originally started as an answer to this question on Reddit: When to use lambda or proc vs. regular functions. As with all my writing goes, it got so large that I had to convert it to a blog post.

A higher order function is a function that
- takes another function as a parameter,
- returns a function, or
- does both.
It's a very important and powerful concept in functional programming, and Ruby has a first-class support for higher-order functions, via its delicious flavors like blocks, procs, and lambdas.
Nugs And Negative Failure Demand
In this article I’m going to take a look at software quality as a way to differentiate between junior, mid-level, and senior software engineers, through the lens of failure demand, purely so that I can introduce a new concept that I thought up on a walk today, which I’m calling negative failure demand.
Business Class 1.1 released with Paddle Billing, an improved CRUD generator, and new pricing
The Rails SaaS boilerplate Business Class goes 1.1. Here’s what’s new.
Paddle Billing
The release of Business Class had an unfortunate timing since Paddle just recently announced all new offering called Paddle Billing. But it didn’t stop me. I worked hard last month and rewrote all functionality of Paddle Classic to Billing for this version of Business Class. The whole integration is also based on latest version of Pay and comes with an even larger set of tests.
Business Class is therefore now the very first Rails template supporting Paddle Billing.
Improved generator
Business Class originally shipped with a revamped Rails scaffold generator with automatic team scoping, but the new…
Lately I’ve been messing around with writing a GraphQL parser called TinyGQL. I wanted to see how fast I could make a GraphQL parser without writing any C extensions. I think I did pretty well, but I’ve learned some tricks for speeding up parsers and I want to share them.
Today we’re going to specifically look at the lexing part of parsing.
Lexing is just breaking down an input string in to a series of tokens.
It’s the parser’s job to interpret those tokens.
My favorite tool for tokenizing documents in Ruby is StringScanner
.
Today we’re going to look at a few tricks for speeding up StringScanner
based lexers.
We’ll start with a very simple GraphQL lexer and apply a few tricks to speed it…
A very basic lexer
He…
In this episode, Jason, Chris, and Andrew start us off with a conversation about burger toppings preferences, discussing whether certain ingredients should be included in “the works” and sharing tips to prevent burger slippage. The discussion transitions to programming topics, exploring the challenges of working with multiline environment variables and the intricacies of Bash scripting. The guy’s dive into the benefits of building UI components using frameworks like Tailwind CSS and Alpine.js, emphasizing the importance of well-organized and specialized components for better code management. The conversation also touches on the desire for more pre-built component libraries in the…