Consider the following models and form models: class Parent < ApplicationRecord has_many :children, class_name: 'Child', foreign_key: 'parent_id...

johnnunemaker.com

PostgreSQL has partial indexes. With a partial index you tell Postgres to only index rows matching a given query.

The Truemail gem (not to be confused with truemail.io) allows validating email addresses, e.g. when users enter them into a...

Using Ruby 1.8.7 you will not be able to use the maximum versions Rubygems 1.8.30 and Bundler 1.17.3 with https://...

github.com

Minidusen lets you find text in associated records. Assume the following model where a Contact record may be associated with...

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...

makandra dev

While debugging a SPF record I found spf-record.de to be very helpful. it lists all IPs that are covered by...

ActiveRecord provides the ids method to pluck ids from a scope, but what if you need to pluck Global IDs...

When you use Sentry to monitor exceptions, an important feature is Sentry's error grouping mechanism. It will aggregate similar...

If you have a very large datadir in MariaDB and you want to transfer the data to another host (e.g...

"Open-source software (OSS) is great. Anyone can use virtually any open-source code in their projects." Well, it depends...

If you have a :string or :text field, you should pair it with a model validation that restricts its length...

makandra dev
github.com

FactoryBot allows to create traits from Enums since version 6.0.0 The automatic definition of traits for Active Record enum attributes...

In a web application you sometimes have tasks that can not be processed during a request but need to go...

makandra dev
select2.org

Select2 comes with AJAX support built in, using jQuery's AJAX methods. ... For remote data sources only, Select2 does not...

Speaker today is Henning Koch, Head of Development at makandra. This talk will be in German with English slides.

When you have many changes, and you want to spread them across different commits, here is a way to stage...

millarian.com

In Active Record you can use named bindings in where-conditions. This helps you to make your code more readable...

Embedding videos on a website is very easy, add a tag to your source code and it just works...

We can use ActiveRecord's where to add conditions to a relation. But sometimes our condition is not on the...

makandra dev

Or: How to avoid and refactor spaghetti code Please note that I tried to keep the examples small. The effects...

This is a personal post-mortem analysis of a project that was mainly build to provide a REST API to...