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.

Ruby: How to use global variables for a conditional debugger

Global variables can temporarily gate a Ruby debugger, avoiding repeated stops in callbacks and specs when only one execution path matters.

Heads up: Sidekiq per default silently fails when retries are exhausted!

Sidekiq retries can run out silently, leaving failed jobs only in the dead queue. Add explicit notification logic when permanent worker errors exhaust retries.

RSpec: Using helpers in view specs

View specs can crash on undefined helper methods; enabling config.action_controller.include_all_helpers or including helper modules makes view rendering work.

Rails: Integrating shoelace components

Web components from Shoelace can be integrated into a Rails app with webpack and Unpoly, offering an alternative setup to the official approach.

Capybara: Quick checking for element presence (without retries or timeout)

Capybara presence checks can wait for seconds or raise on find; has_css? with wait: 0 returns immediately for quick boolean checks.

Nested ActiveRecord transaction pitfalls

Nested ActiveRecord transactions can hide inner ActiveRecord::Rollback exceptions or fire after_commit callbacks too early, depending on joinable: false and requires_new.

Capybara: Find an element that contains a string

Capybara can locate DOM nodes by text content using text: with a selector or regular expression, avoiding unsupported CSS string-matching selectors.

Always convert and strip user-provided images to sRGB

User-uploaded images can lose correct colors if metadata is stripped before color conversion. Converting to sRGB and reattaching the profile keeps browser rendering consistent.

Ruby: How to determine the absolute path relative to a file

Use File.expand_path with __dir__ or __FILE__ to build file paths that stay correct regardless of the caller’s working directory.

Using ngrok for exposing your development server to the internet

Temporary public access to a localhost development server is useful for testing on another device or through TLS without port forwarding or self-signed certificates.