You can check the maximum client Redis database size in Sidekiq with this command. Sidekiq.redis { |redis| puts redis.info.fetch('maxmemory_human...
For Selenium tests, your browser starts in your local timezone, or whatever your system's environment specifies. This is usually...
Why Rails has multiple schema formats When you run migrations, Rails will write your current database schema into db/schema.rb. This...
DirectUpload allows you to upload files to your file storage without having to wait for the form to submit. It...
ActiveStorage does not provide any built-in way of implementing authentication for the available DirectUpload endpoint in Rails. When using...
SVG files often contain redundant information, like editor metadata or hidden elements. When esbuild handles your static assets, you can...
PostgreSQL can cosplay as a full-text search engine. It doesn't have the features or fidelity of ElasticSearch or...
Method delegation in Rails can help you to keep your code organized and avoid deep call chains (law of demeter...
There are several ways to run a single spec. I usually copy the spec file path with the line number...
Given there is a user with an attachable avatar: class User < ApplicationRecord has_one_attached :avatar end
The key to unlocking the full potential of LLMs in coding lies in crafting precise prompts. The main challenge is...
When debugging slow SQL queries, it’s helpful to understand the database engine's query plan. Whenever you execute a...
In Slack, the settings dialog only offers a fixed selection of fonts. You can use any font you like using...
Rails wraps your parameters into an interface called StrongParameters. In most cases, your form submits your data in a nested...
Elements can be hidden and shown by toggling the display property. However, this is not animatable, so we often turn...
Also see the list of IRB commands. Switching the context Changes the "default receiver" of expressions. Can be used to...
When Ruby objects are inspected in any modern IRB, some objects (like ActiveRecord instances) are rendered with neat colors and...
Rails' fragment caching caches subtrees of an HTML document tree. While constructing that tree though, it can be really hard...
YJIT is Ruby's default just-in-time compiler. It is considered production-ready since Ruby 3.2 (source).
Git has the concept of hooks: bash scripts that are invoked at certain points in the Git lifecycle. One handy...
A lesser known fact about PG enums is that they are ordered. This can be really handy when values have...
We recently migrated a Rails application from yarn to npm. We decided to go this step instead of upgrading to...
Zeitwerk is the new autoloader of Rails. It is mandatory starting with Rails 7.0. Sometimes, a model needs to know...
Rails 7.1 added the normalizes method which can be used to normalize user input. It lets you define the fields...