Skip to content

Commit

Permalink
Client.exists?(1,2,3) and Client.exists?([1,2,3]) does not work
Browse files Browse the repository at this point in the history
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])
  • Loading branch information
shernade committed Sep 4, 2013
1 parent 67d88b5 commit 90155b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions guides/source/active_record_querying.md
Expand Up @@ -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.
Expand Down

0 comments on commit 90155b4

Please sign in to comment.