We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
all
1 parent e18585f commit 5d906afCopy full SHA for 5d906af
README.adoc
@@ -1101,6 +1101,23 @@ User.where.not(status: 'active', plan: 'basic')
1101
User.where.not('status = ? AND plan = ?', 'active', 'basic')
1102
----
1103
1104
+=== Redundant `all` [[redundant-all]]
1105
+Using `all` as a receiver for Active Record query methods is redundant.
1106
+The result won't change without `all`, so it can be removed.
1107
+
1108
+[source, ruby]
1109
+----
1110
+# bad
1111
+User.all.order(:created_at)
1112
+User.all.find(id)
1113
+User.all.where(id: ids)
1114
1115
+# good
1116
+User.order(:created_at)
1117
+User.find(id)
1118
+User.where(id: ids)
1119
1120
1121
== Migrations
1122
1123
=== Schema Version [[schema-version]]
0 commit comments