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

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

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

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

You don't want sensitive user data in your logs. Background Rails per default filters sensitive data like...

Disclaimer This card is a collection of guides and things to have in mind when upgrading to a specific version...

github.com

For my computer science bachelor's thesis I programmed and evaluated a CLI Test Case Prioritization (TCP) tool for makandra...

makandra dev

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.

Rails' Strong Parameters enable you to allow only specific values from request params to e.g. avoid mass assignment.

An introduction to mangling When you minify ("compress", "optimize") your JavaScript for production, the names of your functions and variables...

Rails offers several methods to manage three types of different cookies along with a session storage for cookies. These...