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.
2 parents 03f02a3 + 035aeaf commit 7ad8bb9Copy full SHA for 7ad8bb9
README.adoc
@@ -858,12 +858,18 @@ User.find_by(email: email)
858
User.find_by(first_name: 'Bruce', last_name: 'Wayne')
859
----
860
861
-=== Where Not [[where-not]]
+=== Hash conditions [[where-not]] [[hash-conditions]]
862
863
-Favor the use of `where.not` over SQL.
+Favor passing conditions to `where` and `where.not` as a hash over using fragments of SQL.
864
865
[source,ruby]
866
867
+# bad
868
+User.where("name = ?", name)
869
+
870
+# good
871
+User.where(name: name)
872
873
# bad
874
User.where("id != ?", id)
875
0 commit comments