aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorJason Kurian <JaKXz@users.noreply.github.com>2017-02-22 18:20:06 -0500
committerGitHub <noreply@github.com>2017-02-22 18:20:06 -0500
commit1ee6710b54c013d31951ce22c74ac72377ebbbf6 (patch)
treed09851c6ba660f226dd289a6d664a44d21bee5d8 /README.md
parent668da2dfa951ea43f9b2c1171b225b10dba50a3a (diff)
downloadrails-1ee6710b54c013d31951ce22c74ac72377ebbbf6.tar.gz
rails-1ee6710b54c013d31951ce22c74ac72377ebbbf6.tar.bz2
rails-1ee6710b54c013d31951ce22c74ac72377ebbbf6.zip
docs: add distinct to README
Diffstat (limited to 'README.md')
-rw-r--r--README.md9
1 files changed, 8 insertions, 1 deletions
diff --git a/README.md b/README.md
index 292b7fdbca..2872589524 100644
--- a/README.md
+++ b/README.md
@@ -150,7 +150,14 @@ The `OR` operator works like this:
users.where(users[:name].eq('bob').or(users[:age].lt(25)))
```
-The `AND` operator behaves similarly.
+The `AND` operator behaves similarly. The exception is the `DISTINCT` operator, which is not chainable:
+
+```
+posts = Arel::Table.new(:posts)
+posts.project(posts[:title])
+posts.distinct
+posts.to_sql # => 'SELECT DISTINCT "posts"."title" FROM "posts"'
+```
Aggregate functions `AVG`, `SUM`, `COUNT`, `MIN`, `MAX`, `HAVING`: