Active Storage Variants: Multiple Sizes and Testing Pitfalls
Active Storage's variant API gets rough past the basic thumbnail case: multiple sizes, per-attachment metadata, and tests that break on file-not-found errors.
254 posts. Browse by category or tag, or use search.
Active Storage's variant API gets rough past the basic thumbnail case: multiple sizes, per-attachment metadata, and tests that break on file-not-found errors.
Comparing srcset and picture, the native HTML approach to responsive images, against JavaScript solutions like jQuery Foundation Interchange.
A one-line feature request, recording why a student failed a course, walks through three schema options: a nullable column, a normalized table, and jsonb.
Intermittent pgpool connection drops in Kubernetes usually trace to max_connections, idle timeouts, or NetworkPolicy issues, found layer by layer.
User impersonation lets an admin temporarily act as another user for debugging and support, and the pretender gem handles the current_user switch and session state.
GKE deployments can pass every readiness probe and still serve 502s, because Kubernetes probes and the Cloud Load Balancer run two separate health checks.
Bind-mounted host directories make Docker Desktop file access painfully slow on macOS and Windows, and this covers volumes, docker-sync, Mutagen, and WSL 2 fixes.
A practical breakdown of when to mock external dependencies in Rails tests versus using the real thing, built around the test pyramid, VCR, WebMock, and Pact.
Google Cloud CDN can compress responses with Brotli or Gzip automatically, covering the compressionMode setting, cache invalidation, and verifying it works.
Rails 7's button_to wraps a form around the button instead of rendering a plain input, which silently breaks existing CSS selectors and JavaScript click handlers.