For Rails models where only one of multiple attributes may be filled out at the same time, there is no...

greg.molnar.io

Greg Molnar has written a neat article about creating a single-file Rails app. This is not meant for production...

This should be fixed in the latest LTS-branches of our mysql2 fork, 0.2.x-lts and 0.3.x-lts...

When paginating records, we usually need to know the number of total records in order to render pagination links. Popular...

joshmcarthur.com

I recently wanted to add a model for address information but also wanted to add a unique index to those...

blog.saeloun.com

Imagine these models and associations: class Deck < ApplicationRecord has_many :cards end class Card < ApplicationRecord belongs_to :deck, optional: true...

There is a way to use multiple databases in Rails. You may have asked yourself how you're able to...

tl;dr You can use attribute? as shorthanded version of attribute.present?, except for numeric attributes and associations. Technical Details

You can use Unpoly's up.on with a named listener function and immediately unbind this event listener with { once: true...

If you're using many terraform root modules in a repository, downloading common providers like the AWS one can quickly...

DevOps Curriculum

Schau dir den unter Inhalte verlinkten Udemy Kurs an. Die Zugangsdaten für Udemy bekommst Du von deinem Mentor. Überspring Inhalte...

Resources RubyGuides: Mastering Ruby Regular Expressions Using regular expressions in JavaScript Testing regular expressions visually Regular Expressions: Quantifier modes...

Learn to create test data effectively using factories. Decouple tests by having each test start with an empty database...

JavaScript code can access and manipulate the browser's DOM tree. Using JavaScript we can add interactive behavior to our...

Since Rails 6.1, if we use where.not with multiple attributes, it applies logical NAND (NOT(A) OR NOT(B)) instead...

You can use RSpec::Matchers.define_negated_matcher to define a negated version of an existing matcher. This is particularly useful...

Elasticsearch defaults to go into readonly mode when you run low on disk space (< 95%). You might then see an...

web.archive.org

Rails 6.1 has a "strict loading" mode that forces the developer to preload any association they plan to use. Associations...

A flaky test is a test that is often green, but sometimes red. It may only fail on some PCs...

makandra Curriculum

Basic validations Read the Rails Guide on ActiveRecord Validations. You should have an overview which kinds of validations are built...

This RailsCast demonstrated a very convenient method to activate VCR for a spec by simply tagging it with :vcr.

We had a card that described how to install multiple mysql versions using mysql-sandbox. Nowadays with the wide adoption...

If you end up with an Elasticsearch cluster which has a very different disk usage on it's nodes you...

moncefbelyamani.com

The linked article points out that COUNT queries might be unexpectedly slow in PostgreSQL. If you just need to know...