DEV: Hand-pick Rails/WhereNot autofixes (#35117)

We can't enable `Rails/WhereNot` lint/autofix, because it would break
code that uses mini_sql instead of AR (which rubocop, and tbh also we,
can't easily differentiate)

Those are safe because they either:
* are executed in AR model scope definitions
* are clearly chained starting from a AR model
* are less-clearly chained, but still can be traced to a AR model/scope

---------

Co-authored-by: Loïc Guitaut <loic@discourse.org>
This commit is contained in:
Jarek Radosz
2025-10-03 13:29:22 +02:00
committed by GitHub
co-authored by Loïc Guitaut
parent e5ca38d2be
commit a54e3208cb
62 changed files with 128 additions and 146 deletions
@@ -179,7 +179,7 @@ describe TopicView do
TopicView.new(
topic.id,
user,
post_number: topic.posts.where("deleted_at IS NOT NULL").pick(:post_number),
post_number: topic.posts.where.not(deleted_at: nil).pick(:post_number),
)
expect(near_view.desired_post.id).to eq(post.id)