When you want to filter records in a model where a string column roughly matches a given term, you can...
You can check the maximum client Redis database size in Sidekiq with this command. Sidekiq.redis { |redis| puts redis.info.fetch('maxmemory_human...
In Rails, the implicit_order_column (added in Rails 6) is a configuration option that helps you define the default...
Why Rails has multiple schema formats When you run migrations, Rails will write your current database schema into db/schema.rb. This...
Here is a workaround for when you want to use text-wrap: balance but must also render nicely for browsers...
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...
PostgreSQL can cosplay as a full-text search engine. It doesn't have the features or fidelity of ElasticSearch or...
Given there is a user with an attachable avatar: class User < ApplicationRecord has_one_attached :avatar end
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...
Here is a bash script that I use to auto-configure displays on Ubuntu 24.04 with Xorg. Background
When debugging slow SQL queries, it’s helpful to understand the database engine's query plan. Whenever you execute a...
If you need to pre-generate a scram-sha256 password hash for use with postgres, e.g. for using it with...
Rails wraps your parameters into an interface called StrongParameters. In most cases, your form submits your data in a nested...
The new params.expect method in Rails 8 improves parameter filtering, addressing issues with malformed input and enhancing security. It provides...
Also see the list of IRB commands. Switching the context Changes the "default receiver" of expressions. Can be used to...
With Ubuntu 24.04 it's not longer possible to setup FDE with BTRFS The new installer won't offer you...
In development, we store files using ActiveStorage's disk service. This means that stored files are served by your Rails...
Some key highlights and points from the linked article TestProf II: Factory therapy for your Ruby tests. The Problem with...
The general purpose T instance types are a good starting point. But depending on the CPU utilization of your workload...
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...