A Rails script lives in lib/scripts and is run with bin/rails runner lib/scripts/.... They are a simple tool to perform...

I, [2024-01-21T06:22:17.484221 #2698200] INFO -- : [4cdad7a4-8617-4bc9-84e9-c40364eea2e4] test

github.com

There are a few tools to combat the dreaded n+1 queries. The bullet gem notifies you of missing eager...

Your development server is usually running on an insecure HTTP connection which is perfectly fine for development.

Here are some hints on best practices to maintain your tasks in larger projects. Rake Tasks vs. Scripts

unpoly.com

Version 3.7.0 broke some things in complex forms. Sorry for that. Concurrent user input is hard. 3.7.1 This change fixes...

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

makandra dev

I recently did a quick research on how to better write down multiline statements like this: # Dockerfile RUN export DEBIAN...

edgeapi.rubyonrails.org

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

This Capistrano task runs a command on all servers. bundle exec cap production app:run cmd='zgrep -P "..." RAILS_ROOT/log/production.log...

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

makandra dev

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

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

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

Most of our applications use CarrierWave for file uploads. CarrierWave has an integrated processing mechanism for different file versions with...

Given you have an array column like this: create_table "users", force: :cascade do |t| t.integer "movie_ids", default: [], array...

thegnar.com

View specs are a powerful tool to test several rendering paths by their cases instead of using a more costing...

github.com

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