What is Ruby doing on Rails?
Hello, you're reading Infinum Ruby Drops, bringing you the latest Ruby and Rails related news straight to your inbox every week.
Tracking a Ruby memory leak in 2021
An up-to-date and as-simple-as-it-can-be reference on the main steps towards tracking a memory leak.
Read More
Rails
At GitHub, we recently added a new feature to Rails that will be available in 7.0: support for handling associations across database clusters.
Rails apps tend to start simple, with clean models and controllers. Then you start adding features. Before you know it, your models and controllers are big, unwieldy, and hard to understand. Refactoring into service objects is a great way to split these big pieces up, so they're easier to understand.
Ruby
We can now pass expressions and range using the pin (^) operator.
When you look at a Factory Bot factory definition, the syntax might look somewhat mysterious. The goal of this tutorial is to demystify the syntax. The way we’ll do this is to write our own implementation of Factory Bot from scratch.
Blast from the past
The hardware and software worlds may seem poles apart, and in many ways, they indeed are. But there’s a wealth of knowledge that each can learn from the other.
The first concern of the architect is to make sure that the house is usable; it is not to ensure that the house is made of brick. — Uncle Bob
Beyond Ruby
There is a mental framework that has worked well for me across different teams, codebases and systems. I categorize technical debt in 3 buckets: code, data, and architecture. Let’s go over them now with some examples.
Data within a database exists across multiple tables, JOINs allow you to combine datasets into new tables for analysis.
Repository of the week
There’s a new gem in town! It’s a memoization gem called MemoWise (pun very much intended) and we think it’s the best way to memoize methods in Ruby.