Why Rails has multiple schema formats When you run migrations, Rails will write your current database schema into db/schema.rb. This...

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

When debugging slow SQL queries, it’s helpful to understand the database engine's query plan. Whenever you execute a...

Rails wraps your parameters into an interface called StrongParameters. In most cases, your form submits your data in a nested...

makandra dev
impactahead.com

Also see the list of IRB commands. Switching the context Changes the "default receiver" of expressions. Can be used to...

To reverse lookup a fixture by its table name and id, use the following approach on ActiveRecord::FixtureSet: table = 'users...

In development, we store files using ActiveStorage's disk service. This means that stored files are served by your Rails...

When Ruby objects are inspected in any modern IRB, some objects (like ActiveRecord instances) are rendered with neat colors and...

We recently migrated a Rails application from yarn to npm. We decided to go this step instead of upgrading to...

While the main goal always is to prevent long-running queries in the first place, automatic timeouts can serve as...

github.com

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

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

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

This card describes two 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...

Why do we migrate? Due to a change in licensing, we cannot provide Elasticsearch versions >= 8.0. Version 7.17.x will...

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

makandra dev

10.0.0 2024-03-07 Compatible changes console command: You can now globally disable the IRB multiline feature by setting irb...

Today I stumbled across a pretty harmless-looking query in our application which turned out to be pretty harmful and...