Blog

Ruby

89 posts tagged ruby — the same founder-tested patterns, filtered.

Custom ordering without custom SQL with Ruby on Rails 7

Custom ordering without custom SQL with Ruby on Rails 7

Ordering records by an enum in Rails 7 without hand-written SQL: in_order_of puts the rows in the sequence you name.
Placeholder Image

How to Configure SimpleCov in Rails

A working SimpleCov config for Rails, line by line: what each setting does, which filters actually matter, and why your coverage number moves when you add one.
How a large transaction can be a source of DB deadlocks and how this can be fixed.

How a large transaction can be a source of DB deadlocks and how this can be fixed.

Recently in a project, we encountered the fact that sometimes we had a DB Deadlocks error.
How to keep clean Ruby on Rails views with the Null Object pattern

How to keep clean Ruby on Rails views with the Null Object pattern

One of the most common errors developers encounter is NoMethodError. It occurs when code is executed according to a script not provided by the programmer.
Troubleshooting ruby build

Troubleshooting ruby build

Have you found problems building ruby on a local machine? How to configure your local environment once and for all?
Custom templates for Rails scaffolding

Custom templates for Rails scaffolding

Rails has a very handy tool for rapid development called scaffolding. Often programmers ignore it, because some things have to be written by hand anyway.
Auto-install system dependencies for Ruby on Rails

Auto-install system dependencies for Ruby on Rails

Let's integrate Homebrew into our Ruby on Rails Project local set up.
How to avoid callbacks using services.

How to avoid callbacks using services.

Often, programmers abuse callbacks, not fully understanding that their code will ultimately be confusing and non-obvious.
Incremental lint fixes by GitHub Actions

Incremental lint fixes by GitHub Actions

How do you apply new lint rules to the legacy project with active development?
Data migrations with Rails

Data migrations with Rails

Data migration is a common part of working with databases, and Ruby on Rails developers have many tools at their disposal.

Reading this because something is going wrong?

A free code audit gives you a written assessment of your codebase in plain English.

Get a Free Code Audit

Rated 4.8/5 on Clutch · you keep the write-up either way