web.archive.org

Rails 6.1 has a "strict loading" mode that forces the developer to preload any association they plan to use. Associations...

A flaky test is a test that is often green, but sometimes red. It may only fail on some PCs...

makandra dev

If you want Sidekiq to be able to talk to Redis on staging and production servers, you need to add...

makandra Curriculum

Basic validations Read the Rails Guide on ActiveRecord Validations. You should have an overview which kinds of validations are built...

Within development and test environments, Rails is usually configured to show a detailed debug page instead of 404s. However, there...

This RailsCast demonstrated a very convenient method to activate VCR for a spec by simply tagging it with :vcr.

We are using Spring in our tests for sequential test execution but not for parallel test execution. And Rails requires...

Rails has the handy controller method send_file which lets us download files easily. We can decide whether the file...

We had a card that described how to install multiple mysql versions using mysql-sandbox. Nowadays with the wide adoption...

It seems like changing the HTTP_ACCEPT_LANGUAGE is not possible for a headless chrome. On Ubuntu the headless Chrome...

I ran into a situation in which I received the yarn integrity check warning when starting the rails console even...

I encountered a unlucky behavior of byebug 11.1.3 (the most recent version at time of writing) when using it with...

When storing files for lots of records in the server's file system, Carrierwave's default store_dir approach may...

When deleting a record in your Rails app, Carrierwave automatically takes care of removing all associated files. However, the file...

makandra dev

Webpack builds can take a long time, so we only want to compile when needed. This card shows what will...

To attach files to your records, you will need a new database column representing the filename of the file...

When your Rails application server raises error, Capybara will fail your test when it clears the session after the last...

makandra dev

In Ruby (almost) everything is an Object. While this enables a lot of powerful features, this concept might be confusing...

The ActionDispatch module of Rails gives you the helper method flash to access the flash messages in a response.

makandra dev

To ensure Spring is not running: bin/spring stop pkill -f spring To prevent Spring from starting again: export DISABLE_SPRING...

By default parallel_tests will spawn as many test processes as you have CPUs. If you have issues with flaky...

CarrierWave comes with a set of default configuration options which make sense in most cases. However, you should review these...

Sometimes you want to have a time in a given timezone independent from you Rails timezone settings / system timezone. I...

tl;dr: Upgrade the gem to at least 4.0.1 When you use rspec_rails in a version < 4 with Rails...