You can check the maximum client Redis database size in Sidekiq with this command. Sidekiq.redis { |redis| puts redis.info.fetch('maxmemory_human...
Why Rails has multiple schema formats When you run migrations, Rails will write your current database schema into db/schema.rb. This...
For long running scripts it is useful to show a indicator for the progress in the terminal. Alternatively 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...
Bundler allows you to specify the name of the Gemfile you want to bundle with the BUNDLE_GEMFILE environment variable...
To reverse lookup a fixture by its table name and id, use the following approach on ActiveRecord::FixtureSet: table = 'users...
Some key highlights and points from the linked article TestProf II: Factory therapy for your Ruby tests. The Problem with...
When Ruby objects are inspected in any modern IRB, some objects (like ActiveRecord instances) are rendered with neat colors and...
Capistrano 3 has a doctor task that will print information about Environment: Ruby, Rubygems and Bundler versions List of Capistrano...
YJIT is Ruby's default just-in-time compiler. It is considered production-ready since Ruby 3.2 (source).
Slow test suites are a major pain point in projects, often due to RSpec and FactoryBot. Although minitest and fixtures...
While the main goal always is to prevent long-running queries in the first place, automatic timeouts can serve as...
When handling nested hashes the RSpec output is often hard to read. Here the gem super_diff could help.
I recently stumbled upon the Rails feature composed_of. One of our applications dealt with a lot of addresses and...
Rails' default logger prefixes each log entry with timestamp and tags (like request ID). For multi-line entries, only the...
Recently I needed to benchmark an Active Record query for performance measurements. I wrote a small script that runs each...
It's possible to implement simple custom RuboCop cops with very little code. They work exactly the same like existing...
Sometimes we have to write code that behaves differently based on the version of a specific gem or the Ruby...
I recently stumbled over a quirk in the way Ruby handles local variables that I find somewhat dangerous. Consider:
I was recently asked to optimize the response time of a notoriously slow JSON API endpoint that was backed by...
While most Rails Apps are tied to at least one external REST API, machine-to-machine communication via GraphQL is...
When Rails releases a new version of their gems, they also release a number of npm packages like @rails/activestorage or...
This card shows an uncommon way to retrieve a file using selenium where JavaScript is used to return a binary...