Why this matters
Keeps work in the database and reduces memory usage.
Combine ActiveRecord relations with or instead of materializing arrays or concatenating results.
Keeps work in the database and reduces memory usage.
Side-by-side examples engineers can pattern-match during review.
(User.active.to_a + User.admin.to_a).uniqUser.active.or(User.admin).distinctscope1.to_a + scope2.to_ascope1.or(scope2)From the same buckets as this rule.
All static JS/CSS/font/image files MUST use content-hashed filenames (e.g., app.9c1a7b.js) and be served with "Cache-Control: public, max-age=31536000, immutable". HTML and other non-fingerprinted documents MUST be served with "Cache-Control: no-cache" (or equivalent) to enable conditional revalidation.