mirror of
https://github.com/discourse/discourse.git
synced 2026-08-09 04:28:29 -05:00
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:
co-authored by
Loïc Guitaut
parent
e5ca38d2be
commit
a54e3208cb
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user