If you have an element with significant border-radius (e.g. 50% for a circle) and you want inline content (i.e...

You can use the config.x configuration in combination with config_for to configure global settings for your Rails 4.2+ application...

makandra dev
alan.norbauer.com

A list of clever debugging tricks. TOC: Advanced Conditional Breakpoints monitor() class Calls Call and Debug a Function Pause Execution...

You can ignore certain commits when using git blame with the --ignore-revs-file option. This is handy to ignore...

edgeapi.rubyonrails.org

The linked article suggests an interesting way to speed up tests of Rails + Postgres apps: PostgreSQL allows the creation of...

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

makandracards.com

A general overview about why and how we migrate can be found under Migrating from Elasticsearch to Opensearch

OpenAI is currently limiting the Audio generating API endpoint to text bodies with a maximum of 4096 characters.

#pluck is commonly used as a performant way to retain single database values from an ActiveRecord::Relation Book.pluck(:title, :price...

Added: State machine can now use the :prefix-option to avoid name collision if you define multiple state machines on...

makandra dev

Getting CSS (and JS) live reloading to work in a esbuild / Rails project is a bit of a hassle, but...

Make sure that you use the correct property when editing an HTML attribute. Using innerHTML with unsafe arguments makes your...

github.com

In my career, I have consumed hundreds of REST APIs and produced dozens. Since I often see the same mistakes...

When you find similar groups of expect calls in your tests, you can improve readability by extracting the group into...

If you ever need to restore exact records from one database to another, Marshal might come in handy. Marshal.dump is...

docs.ruby-lang.org

The sprintf method has a reference by name format option: sprintf("% d : % f", { :foo => 1, :bar => 2 }) # => 1 : 2.000000

ruby-doc.org

Ruby has the class Rational which allows you to store exact fractions. Any calculation on these variables will now use...

bitsofco.de

Even when you app has no CSS at all, you still inherit a default user agent stylesheet from your browser...

Every modern Rails app should have a Content Security Policy enabled. Very compatible default The following "default" is a minimal...

While upgrading CarrierWave from version 0.11.x to 3.x, we encountered some very nasty fails. Below are the basic...

All direct child directories of app are automatically added to the eager- and autoload paths. They do NOT create a...

On the Rails console, assigning an object to a variable can lead to this strange error (without stacktrace): irb > recipient...

TLDR Using .includes or .eager_load with 1-n associations is dangerous. Always use .preload instead. Consider the following ActiveRecord...