Mastodon

An introduction to Barley, the fast model serializer

How I built and open-sourced Barley, a fast and simple model serializer gem for Rails, born from real-world performance needs and benchmarked against the best in the Ruby ecosystem.

May 6, 2025

Ruby Best Practices - Method Arguments

Simple rules for ordering Ruby method arguments — put optional arguments last, and switch to keyword arguments when you have more than one optional parameter.

January 12, 2024
Photo by Michael Dziedzic on Unsplash

Love your error messages as thyself

Stop ignoring error messages and start reading them — it will make you a better developer and help you understand your language from the inside out.

May 17, 2022
Photo by Debby Hudson on Unsplash

Writing code for your future self

A set of guidelines to write clean, readable code that you — and your future self — will thank you for.

November 21, 2021

An alternative to the ActiveRecord after_initialize callbacks

Avoiding the callback hell in Rails by creating a simple method in the model to initialize associated records.

October 3, 2020

Chaining conditions in regular expressions

Unleash the full power of regular expressions by chaining conditions together.

October 3, 2020

Prevent Devise from sending confirmation emails

When you need to import users into a new Rails app using Devise, you may want to skip sending confirmation emails. Here’s how to do it by overriding an instance method in the User model.

January 26, 2020