Pattern: Missing use of where.missing(...)
Issue: -
Use where.missing(...)
to find missing relationship records.
This rule is enabled in Rails 6.1 or higher.
# bad
Post.left_joins(:author).where(authors: { id: nil })
# good
Post.where.missing(:author)