Customizing Rails error messages for models and attributes

Rails error messages can be overridden at application, model, or attribute scope through locale YAML files, enabling clearer validation feedback than the default generic texts.

Load order of the environment

Rails environment code loads in a fixed boot order, affecting which settings and constants can override others. Knowing the initialization sequence prevents surprises when adding configuration or app code.

Beware of params with non-string values (nil, array, hash)

params can contain nil, arrays, or hashes, so treating request values as plain strings can lead to unsafe lookups and unexpected matches.

Ruby blocks: Braces and do/end have different precedence

{} and do ... end bind blocks to different method calls, which can make print names.map do ... end return an Enumerator instead of the mapped array.

Tod: A Gem for handling daytime without a date

Tod handles time-of-day values without dates, avoiding timezone-related bugs when parsing, comparing, formatting, or storing hours, minutes, and seconds.

Capistrano: Configure environment specific array attributes

Capistrano can adjust array-style settings per environment, letting deployments add or remove linked files without duplicating the base configuration.

Rails I18n scope for humanized attribute names

Custom attribute labels in Rails can be stored in locale files and reused by human_attribute_name and error messages instead of duplicating names in code.

Deployment: Merge consecutive commits without cherry-picking

Skip unready commits during deployment by merging an earlier commit reference instead of cherry-picking, avoiding duplicate history entries later.

The Framework Field Guide - Fundamentals | Unicorn Utterances

Frontend rendering fundamentals are often hard to compare across Vue, Angular and React. A side-by-side guide highlights shared component, rendering and state-sharing concepts.

RSpec: Applying stubs only within a block

RSpec mocks normally persist for a spec; RSpec::Mocks.with_temporary_scope limits temporary stubs to a block and releases them afterward.

Configuring ActionMailer host and protocol for URL generation

ActionMailer URL generation fails without a configured host and protocol. Rails can use hardcoded defaults or derive them from the request for mailers sent outside the request cycle.

Modern HTTP Status codes for redirecting

HTTP redirect handling differs for GET and non-GET requests; newer codes preserve or change the method explicitly, avoiding browser-dependent behavior from 301 and 302.

How to list updateable dependencies with Bundler and Yarn

List outdated gems and packages that can be upgraded, with filters for allowed versions and dependency groups to narrow bulk updates.

Caveat when using Rails' new "strict locals" feature

Rails 7.1 strict locals can make unrelated ArgumentErrors look like render-call failures, obscuring the real source of an error in a partial.

How to tell ActiveRecord how to preload associations (either JOINs or separate queries)

ActiveRecord association loading can use separate queries or joins, and includes may switch between them automatically. preload is the safest default for avoiding surprise eager loading behavior.

Async control flow in JavaScript: Promises, Microtasks, async/await

JavaScript async code often becomes hard to read and error-prone; promises and async/await flatten control flow, model failures, and avoid callback nesting.

Authorize allowed values with assignable_values

Restricting attribute values to user-dependent sets keeps select options and labels in sync while supporting defaults and authorization-aware assignment.

Searchkick: async reindexing fails for rails 7 with redis 4

Searchkick async reindexing can break on Rails 7.1 with Redis 4 because ActiveSupport#with conflicts with the Redis API, causing undefined method 'call' for nil.

Why two Ruby Time objects are not equal, although they appear to be

Time comparisons can fail in tests because Ruby keeps subsecond fractions even when the printed values look identical.

Don't name columns like counter_cache columns in Rails pre v4.2.4

Rails can mistake ordinary columns for cached association counters and return empty has_many collections when the cached value is wrong.

Ruby: You can nest regular expressions

Ruby can interpolate existing Regexp objects into new patterns, preserving modifiers like /i only inside the nested region.

routing-filter is broken with Rails 7.1

routing-filter stops working in Rails 7.1 because find_routes now yields lazily, leaving URL segment filters unapplied and routes unrecognized.

Active Record: Never use optional with a symbol, lambda or proc

Association options can silently skip presence checks when optional is given a symbol, lambda, or proc, allowing invalid records with missing related objects.

Bash script to list git commits by Linear ID

Bash helper for finding git commits by Linear issue ID, including IDs extracted from Linear URLs, and passing options through to git show.