Sometimes you have a file that is related to a project, while not actually being part of it. You'd...
The linked table shows the support lifecycle for Firefox Extended Support Releases (ESR) which we sometimes need to support for...
A Rails script lives in lib/scripts and is run with bin/rails runner lib/scripts/.... They are a simple tool to perform...
There are a few tools to combat the dreaded n+1 queries. The bullet gem notifies you of missing eager...
The linked article suggests an interesting way to speed up tests of Rails + Postgres apps: PostgreSQL allows the creation of...
In Capistrano 3, your Capfile requires 'capistrano/rails/migrations', which brings two Capistrano tasks: deploy:migrate and deploy:migrating. The former checks...
#pluck is commonly used as a performant way to retain single database values from an ActiveRecord::Relation Book.pluck(:title, :price...
If you ever need to restore exact records from one database to another, Marshal might come in handy. Marshal.dump is...
TLDR Using .includes or .eager_load with 1-n associations is dangerous. Always use .preload instead. Consider the following ActiveRecord...
Given you have an array column like this: create_table "users", force: :cascade do |t| t.integer "movie_ids", default: [], array...
We regularly have tasks that need to be performed around a deploy. Be it to notify operations about changed application...
You don't want sensitive user data in your logs. Background Rails per default filters sensitive data like...
For my computer science bachelor's thesis I programmed and evaluated a CLI Test Case Prioritization (TCP) tool for makandra...
With this Ruby script you can print all values in a Redis database to your console (derived from this bash...
When you allow file uploads in your app, a user might upload content that hurts other users. Our primary concern...
In Ruby on Rails ActiveRecord::Relation#merge overwrites existing conditions on the same column. This may cause the relation to...
I found the linked article very helpful to refresh my understanding of database indexes. As a small bonus, it includes...
Maintaining larger projects makes it more difficult to balance refactoring and upgrade tasks according to its actual value. Consider to...
Let's say we have posts with an attribute title that is mandatory. Our example feature request is to tag...
Rails Active Support provides some helpful methods for calculating times and dates, like Duration#ago or Duration#from...
The change_column method for rails migrations support casting with a custom SQL statement. This allows us to change a...
This is a checklist I use to work on issues. For this purpose I extracted several cards related to the...
In the past we validate and set default values for boolean attributes in Rails and not the database itself.
Since Rails 7 you are able to encrypt database information with Active Record. Using Active Record Encryption will store an...