aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorRobin Dupret <robin.dupret@gmail.com>2013-07-26 15:11:58 +0200
committerRobin Dupret <robin.dupret@gmail.com>2013-07-26 15:11:58 +0200
commita8d1412a3227ac3d14a40f0e62c9cd83b515ff95 (patch)
tree1594eb80cca1e3f2f6f21aff07f69bc6f5c7e176 /guides/source
parent3f29a65cd51818e4a5607366ea15f7ef95ba375a (diff)
downloadrails-a8d1412a3227ac3d14a40f0e62c9cd83b515ff95.tar.gz
rails-a8d1412a3227ac3d14a40f0e62c9cd83b515ff95.tar.bz2
rails-a8d1412a3227ac3d14a40f0e62c9cd83b515ff95.zip
Add a SQL example for `not` [ci skip]
To share a certain logic across other examples, let's add a sample SQL code generated by the given Ruby code
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/active_record_querying.md8
1 files changed, 7 insertions, 1 deletions
diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md
index 0592821a14..9252a248b2 100644
--- a/guides/source/active_record_querying.md
+++ b/guides/source/active_record_querying.md
@@ -514,7 +514,13 @@ SELECT * FROM clients WHERE (clients.orders_count IN (1,3,5))
Post.where.not(author: author)
```
-In other words, this query can be generated by calling `where` with no argument, then immediately chain with `not` passing `where` conditions.
+In other words, this query can be generated by calling `where` with no argument,
+then immediately chain with `not` passing `where` conditions. This will generate
+SQL code like this:
+
+```sql
+SELECT * FROM posts WHERE (author_id != 1)
+```
Ordering
--------