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

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

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

evilmartians.com

Some key highlights and points from the linked article TestProf II: Factory therapy for your Ruby tests. The Problem with...

makandra dev

A lesser known fact about PG enums is that they are ordered. This can be really handy when values have...

masilotti.com

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

You can improve your LIKE / ILIKE search queries in PostgreSQL by adding a GIN index with an operate class ("opclass...

Recently I needed to benchmark an Active Record query for performance measurements. I wrote a small script that runs each...

You are given two CSS selectors that you do not control. How can you build a new selector that matches...

Reacting on a class getting added can be done with a mutation observer. Example: const items = document.querySelectorAll('.item') const expectedClass...

github.com

I was recently asked to optimize the response time of a notoriously slow JSON API endpoint that was backed by...

ActiveModel classes have a class method .human_attribute_name. This returns a human-readable form of the attribute: Person.human_attribute...

tl;dr Do not use the option optional on association declarations with a symbol, lambda or proc. Explanation Association declarations...

This card describes four variants, that add a more intuitive workflow when working with nested attributes in Rails + Unpoly:

We are using assignable_values for managing enum values in Rails. Nevertheless Rails is adding more support for enum attributes...

makandra dev

Postgres works differently See PostgreSQL: Difference between text and varchar columns for PostgreSQL-specific info MySQL has 4 different column...

Debugging performance issues in your Rails app can be a tough challenge. To get more detailed insights consider using the...

tl;dr Prefer request specs over end-to-end tests (Capybara) to joyfully test file downloads! Why? Testing file downloads

You can chain multiple Capybara matchers on the page or any element: expect(page) .to have_content('Example Course')