When deleting a record in your Rails app, Carrierwave automatically takes care of removing all associated files. However, the file...
To attach files to your records, you will need a new database column representing the filename of the file...
When your Rails application server raises error, Capybara will fail your test when it clears the session after the last...
CarrierWave comes with a set of default configuration options which make sense in most cases. However, you should review these...
When you repeat a subpattern with a *, + or {...} operator, you may choose between greedy, lazy and possessive modes. Switching modes...
Consider the following models and form models: class Parent < ApplicationRecord has_many :children, class_name: 'Child', foreign_key: 'parent_id...
PostgreSQL has partial indexes. With a partial index you tell Postgres to only index rows matching a given query.
There are several tools for DNS debugging which offer you more or less information. Most of the time the more...
In my experience, the most common sources of memory leaks are APIs like these: addEventListener. This is the most common...
The Truemail gem (not to be confused with truemail.io) allows validating email addresses, e.g. when users enter them into a...
URLs can transport key/value pairs ("parameters") using this syntax: /path?foo=bar If the value is blank, mind these subtle...
When deploying a Rails application that is using Webpacker and Capistrano, there are a few configuration tweaks that optimize the...
Minidusen lets you find text in associated records. Assume the following model where a Contact record may be associated with...
Scroll and touch event listeners tend to be computationally expensive as they are triggered very often. Every time the event...
Sometimes you want to find the inverse of an ActiveRecord scope. Depending on what you want to achieve, this is...
Ubuntu 18.04 uses systemd to manage services. There are basically two commands for listing all services and manipulating the state...
We currently test most of our gems on Travis CI, but want to migrate those tests to Github Actions. This...
While debugging a SPF record I found spf-record.de to be very helpful. it lists all IPs that are covered by...
When loading a database dump created with pg_dump into your database, you might run into an error like
It sometimes happen that a database dump, that would want to insert into your development database, does not match the...
The sidekiq-rate-limiter gem allows rate-limiting Sidekiq jobs and works like a charm. However, it needs to be...
If a model inherits from others or uses many concerns / traits, it might be hard to see in the code...
When logging in Rails, you can use the log_tags configuration option to add extra information to each line, like...
ActiveRecord provides the ids method to pluck ids from a scope, but what if you need to pluck Global IDs...