Sometimes we write plain SQL queries in migrations so we don't have to mock ActiveRecord classes. These two migrations...

We use foreman to start all necessary processes for an application, which are declared in a Procfile. This is very...

Building application assets with esbuild is the new way to do it, and it's great, especially in combination with...

Attaching files to a field that is handled by Carrierwave uploaders (or maybe any other attachment solution for Rails) in...

Jasmine is a great tool to unit test your JavaScript components without writing an expensive end-to-end test for...

Learn to create test data effectively using factories. Decouple tests by having each test start with an empty database...

JavaScript code can access and manipulate the browser's DOM tree. Using JavaScript we can add interactive behavior to our...

RSpec Rails can automatically mix in different behaviors to your tests based on their type tag, for example enabling you...

Since Rails 6.1, if we use where.not with multiple attributes, it applies logical NAND (NOT(A) OR NOT(B)) instead...

TL;DR When using Cache-Control on a Rails application, make sure the Vary: Accept header is set.

makandra dev
github.com

Rack::SteadyETag is a Rack middleware that generates the same default ETag for responses that only differ in CSRF tokens...

makandra dev

Field error steps Spreewald's The...

...field should have an error and The...

...field should have the error...

...steps now...

From Exploring ES6: Module imports are hoisted (internally moved to the beginning of the current scope). Therefore, it doesn’t...

Jasmine is a great way to unit test your JavaScript components without writing an expensive end-to-end test for...

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.

makandra dev

The gem better_errors offers a detailed error page with an interactive REPL for better debugging. I had the issue...

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