From 1f2213414a941b6339fc04636ef376f423aeee6f Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Fri, 21 Jul 2023 11:50:07 +0800 Subject: [PATCH] DEV: Remove redundant line of code (#22734) No need for `limit(1)` when we are already calling `first` --- lib/post_destroyer.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/post_destroyer.rb b/lib/post_destroyer.rb index 0311cfaea40..d8f67083e40 100644 --- a/lib/post_destroyer.rb +++ b/lib/post_destroyer.rb @@ -310,7 +310,6 @@ class PostDestroyer .where.not(user_id: nil) .where.not(post_type: Post.types[:whisper]) .order("created_at desc") - .limit(1) .first if last_post.present?