This note describes a Cucumber step definition that lets you say: Then "Mow lawn" should be an option for "Activity...

As attachments to this card you will find a Cucumber feature and supplementing step definition that you can use to...

tl;dr Since Rails 6.1+ you can use .compact_blank or .compact_blank! to remove blank values from collections (e.g...

github.com

The linked rbenv plugin rbenv-each is very helpful to keep QoL gems up to date that are not part...

I had a huge MySQL dump that took forever (as in: days) to import, while I actually just wanted to...

We recently decided to put static content for HouseTrip.com to Amazon Cloudfront for a faster user experience. This happens fully...

makandra dev

The Rails asset pipeline improves delivery of application assets (javascripts, stylesheets, images, fonts). Here are some basic facts about its...

The goal is to get Jasmine specs running in a Rails project using Webpacker, with the browser based test runner...

xaprb.com

The linked article explains how to get a database-wide lock without creating table rows: This article explains how I...

redis.io

In production, you (or your ops team) should configure a maximum number of bytes that Redis can use to store...

...per group but only one value can be picked for the results. The default behaviour of MySQL prior to version 5.7 will not complain and arbitrarily choose a value. But...

tl;dr In Chrome DevTools in the Sources tab you can activate Event Listener Breakpoints for debugging events. Example

drafts.csswg.org

...invalid calc value is ignored, so you might end up with missing or "random" behavior, depending on where you do this. The above example is valid once you use zero...

Inside before :each blocks you can refer to variables that you introduce via let later on. They do not need...

Around will not happen until after a feature's Background has been processed. Use Before and After to avoid that...

When the Ruby parser module of Ruby-GetText comes across a file in one of its search directories (e.g. lib/scripts...

When you use the send_file method to send a local file to the browser, you can save resources on...

...to a value. The validation is skipped silently when terms is nil. While this behavior is useful to validate acceptance in the frontend and not the admin backend, it also...

Active Record's select method allows you to make use of the power of MySQL select statements. On the one...

...be quite useful to quickly find the JavaScript that is responsible for some (unexpected) behavior. You can use DOM Breakpoints for debugging subtree modifications, attribute modifications or node removal.

This can happen with a very simple model: class Note has_many :attachments end Everything looks normal: Note.all.to_a.size # => 8 Note.all.ids.size...

Yesterday, Rails fixed a security issue (CVE-2014-3514) in Rails 4+. It was possible to use .where...

...new RegExp('^(\\d+) users') # => /^(\d+) users/ Our expression above now works only at the beginning of the matched string, looks for a number (\d+ [1]) and also captures that. Sweet...

When you use the :as option to map a power to a controller method you can now override the generated...