Today I stumbled across a pretty harmless-looking query in our application which turned out to be pretty harmful and...
Any form fields where users enter numbers should be an . Numeric inputs have several benefits over : On mobile or tablet...
tl;dr We recommend configuring Selenium's unhandled prompt behavior to { default: 'ignore' } with the monkey patch below.
A Rails script lives in lib/scripts and is run with bin/rails runner lib/scripts/.... They are a simple tool to perform...
Today I learned that you can animate HTML elements using the Web Animation API's method .animate(keyframes, options) (which...
Multiply by 1x the unit: $number = 13 $length = $number * 1px // => 13px Removing a unit
It happens from time to time that a job in a GitLab pipeline fails. Sometimes, however, the error message is...
You can use the config.x configuration in combination with config_for to configure global settings for your Rails 4.2+ application...
RubyMine has a collaboration feature called "Code With Me". Using it, you can invite someone into your local editor to...
You can ignore certain commits when using git blame with the --ignore-revs-file option. This is handy to ignore...
Getting an entire test suite green can be a tedious task which involves frequent switches between the CLI that is...
In the Gitlab settings the flag Auto-cancel redundant pipelines is enabled by default. This auto-cancels jobs that have...
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...
Ruby has the class Rational which allows you to store exact fractions. Any calculation on these variables will now use...
Every modern Rails app should have a Content Security Policy enabled. Very compatible default The following "default" is a minimal...
For some reason you have to pass the password hash if you want to create a role in postgres. To...
All direct child directories of app are automatically added to the eager- and autoload paths. They do NOT create a...
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...
Both knapsack and parallel_tests have the option to split groups by historic execution time. The required logs for this...
There are multiple ways to redirect URLs to a different URL in Rails, and they differ in small but important...
Rails' url_for is useful for generating routes from a Hash, but can lead to an open redirect vulnerability.