aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorSergio <shernade@gmail.com>2013-09-05 00:40:14 +0200
committerSergio <shernade@gmail.com>2013-09-05 00:40:14 +0200
commit90155b4e28a3887dce9428e9df150ede3d6c7465 (patch)
treef32514016ba65a21ad15928e2d2efe9f0eca0229 /guides/source
parent67d88b5040e93672c4122817a8e3b21720b2d9fd (diff)
downloadrails-90155b4e28a3887dce9428e9df150ede3d6c7465.tar.gz
rails-90155b4e28a3887dce9428e9df150ede3d6c7465.tar.bz2
rails-90155b4e28a3887dce9428e9df150ede3d6c7465.zip
Client.exists?(1,2,3) and Client.exists?([1,2,3]) does not work
The right command for doing that is Client.exists?id:[1,2,3] Exists does not work like find method, in find method you can do Person.find(1, 2, 6) or Person.find([7, 17]) but not Person.exists?(1,2,3) or Person.exists?([1,2,3])
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/active_record_querying.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md
index ba0260c13c..6c06399673 100644
--- a/guides/source/active_record_querying.md
+++ b/guides/source/active_record_querying.md
@@ -1514,9 +1514,9 @@ Client.exists?(1)
The `exists?` method also takes multiple ids, but the catch is that it will return true if any one of those records exists.
```ruby
-Client.exists?(1,2,3)
-# or
-Client.exists?([1,2,3])
+Client.exists?id:[1,2,3]
+or
+Client.exists?name:['John','Sergei']
```
It's even possible to use `exists?` without any arguments on a model or a relation.