We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e18585f + 2159845 commit 2e7d125Copy full SHA for 2e7d125
README.adoc
@@ -1101,6 +1101,26 @@ User.where.not(status: 'active', plan: 'basic')
1101
User.where.not('status = ? AND plan = ?', 'active', 'basic')
1102
----
1103
1104
+=== Redundant `all` [[redundant-all]]
1105
+
1106
+Using `all` as a receiver for Active Record query methods is redundant.
1107
+The result won't change without `all`, so it can be removed.
1108
1109
+[source, ruby]
1110
+----
1111
+# bad
1112
+User.all.find(id)
1113
+User.all.order(:created_at)
1114
+users.all.where(id: ids)
1115
+user.articles.all.order(:created_at)
1116
1117
+# good
1118
+User.find(id)
1119
+User.order(:created_at)
1120
+users.where(id: ids)
1121
+user.articles.order(:created_at)
1122
1123
1124
== Migrations
1125
1126
=== Schema Version [[schema-version]]
0 commit comments