TypeScript basically uses structural typing, which is conceptually quite similar to duck typing, but with static compile-time type checking...
Leaving old unused DB columns around after a migration is confusing for other developers. However, dropping columns too eagerly might...
I use the Gemini web chat interface quite extensively. One thing that is tedious is giving it all the context...
I have a form with a dynamic number of fields. Submitting it worked fine until I tried out a very...
The :test adapter doesn't respect limits_concurrency configuration. Switch to :solid_queue adapter in your test to verify blocking...
Short reference on how to quickly debug the vanilla Rails job adapters. Queue Adapters by Environment Environment Adapter
Sometimes you have a maintenance script where you want to iterate over all ActiveRecord models. Rails provides this out of...
When creating a database table for a join model without further importance, you can use Rails' create_join_table:
When you query the browser for DOM elements, there are some footguns you should know about. Some lists are synchronized...
You want to prevent input to a form field, but all the solutions have side effects: The [readonly] attribute is...
Most of the time, it's a good default to add a unique index on the foreign key when using...
Enable local logging for Sentry when: Debugging Sentry event capture locally Testing error handling without polluting production metrics Developing background...
Full-text search can reach its limits in terms of flexibility and performance. In such cases, trigram indexes (pg_trgm...
Quick reference for passing data from Rails to JavaScript via Unpoly compilers. Haml Attribute Syntax # Ising hash rockets and string...
Quick guide for frequently used compiler selector patterns of Unpoly. 1. BEM Component Pattern When: Reusable UI components with multiple...
Performing COUNT(*) on large tables is slow. Sometimes you don’t need the exact number once results exceed a certain...
In Rails 8 the behavior of the rails db:migrate command has changed for fresh databases (see PR #52830).
GoodJob and ActiveJob rescue exceptions internally, preventing exception_notification from triggering. This can cause silent job failures.To get notified, subscribe...
prettier calls itself an opinionated code formatter. I recommend using it for your JavaScript and TypeScript code. prettier only concerns...
There's a method Integer() defined on Kernel, that typecasts everything into an Integer. Integer("2") # 2 Integer("foo") # Invalid...
Most of the time, when you are interested in any log output, you see the logs directly on your console...
SimpleForm comes with an option browser_validations which could be used to give fields that have a presence validation the...
ActiveRecord computes table names of model classes, and results are usually just like you'd expect. Adding a prefix for...
In Rails 7.2. the feature ActiveRecord.after_all_transactions_commit was added, for code that may run either inside or outside...