ActiveRecord INNER JOIN with Multiple Conditions (Without Lying to Yourself)
Write Rails INNER JOIN queries with multiple conditions using .joins, .where, and .merge. Learn ON vs WHERE placement and verify generated SQL correctly.
Real solutions to SQL → ActiveRecord translation problems. Learn why your queries break, how to fix them, and what Rails actually generates.
New to ActiveRecord? These posts explain the mental model differences that cause bugs.
LEFT JOINs that become INNER JOINs, multiple conditions, and association gotchas
Write Rails INNER JOIN queries with multiple conditions using .joins, .where, and .merge. Learn ON vs WHERE placement and verify generated SQL correctly.
Fix Rails LEFT JOIN + WHERE trap that becomes INNER JOIN. Covers .left_joins, scoped associations, WHERE vs ON, and SQL verification with examples.
Need a FULL OUTER JOIN in Rails? Learn why ActiveRecord doesn’t support it natively and the safest Postgres + UNION workarounds for production.
N+1 queries, includes() side effects, and when ActiveRecord makes things slower
A production-focused preview of Rails 8.2 explaining real-world impact on caching, TypeScript integration, Turbo behavior, and upgrade risks.
Copied SQL into Rails and still got N+1? Rewrote in ActiveRecord and still got N+1? The fix is a set-based mental model: where N+1 really comes from, how to verify it, and the AR patterns that eliminate it safely.
Ruby 4.0.0 is released (Dec 25, 2025). For Rails apps, the real risks are stdlib gem changes (CGI), Net::HTTP behavior shifts, and Bundler 4. Here’s what breaks first, how to fix safely, and what Ruby 4 performance does—and doesn’t—solve.
Master Rails WHERE clause with multiple conditions, OR logic, and SQL strings. Learn WHERE vs HAVING and how to verify generated SQL with real examples.
Rails 8.2 and Ruby 4.0 expose hidden callback costs. Learn why callbacks fail in production and what to use instead.
A production-tested playbook for upgrading to Rails 8.2 with Ruby 4.0. Avoid downtime, lockups, and silent performance regressions.
Rails 8.2 is thread-safe but still slow under load. Learn how Ruby 4.0 exposes connection pool starvation and how to fix concurrency correctly.
Rails 8.2 changes Active Record behavior in ways that hurt performance at scale. Learn what breaks, how Ruby 4.0 exposes it, and how to fix it safely.
Need a FULL OUTER JOIN in Rails? Learn why ActiveRecord doesn’t support it natively and the safest Postgres + UNION workarounds for production.
Master Rails CROSS JOIN with 7 production-safe methods. Learn cartesian products, when to use CROSS JOIN, and how to avoid performance traps in Rails.
Fix Rails LEFT JOIN + WHERE trap that becomes INNER JOIN. Covers .left_joins, scoped associations, WHERE vs ON, and SQL verification with examples.
How to do a SQL CROSS JOIN from ActiveRecord safely: when it’s the right tool, how to express it without losing bind params, and how to avoid accidental Cartesian products.
Write Rails INNER JOIN queries with multiple conditions using .joins, .where, and .merge. Learn ON vs WHERE placement and verify generated SQL correctly.
Ruby 4.0.0 is released (Dec 25, 2025). For Rails apps, the real risks are stdlib gem changes (CGI), Net::HTTP behavior shifts, and Bundler 4. Here’s what breaks first, how to fix safely, and what Ruby 4 performance does—and doesn’t—solve.
Copied SQL into Rails and still got N+1? Rewrote in ActiveRecord and still got N+1? The fix is a set-based mental model: where N+1 really comes from, how to verify it, and the AR patterns that eliminate it safely.
If you know SQL, ActiveRecord can feel pointless—until it saves you from consistency bugs. Here’s the mental model: where SQL alone breaks app invariants, and how to use AR without losing performance.
A production-minded guide to building a modular monolith in Rails using Engines: where boundaries usually leak, how to structure code, and the upgrade-safe patterns that prevent cross-domain coupling.
A production-minded Rails 8.1 devcontainer setup that standardizes Ruby, Node, Postgres, and tooling across a team—plus the real failure modes and how to avoid them.
Ruby 3.5 was released as a preview; Ruby 4.0 shipped. Here’s what actually matters for Rails apps: what won’t change, what can break, and where SQL/ActiveRecord fixes beat runtime upgrades.
A production-focused preview of Rails 8.2 explaining real-world impact on caching, TypeScript integration, Turbo behavior, and upgrade risks.