ActiveRecord INNER JOIN with Multiple Conditions (Without Lying to Yourself)
How to express INNER JOINs with multiple conditions in Rails without changing semantics by accident. Learn when Rails puts predicates in WHERE vs ON, how merge/default_scope can surprise you, and the patterns that stay correct when you later switch to LEFT JOIN.