From 90155b4e28a3887dce9428e9df150ede3d6c7465 Mon Sep 17 00:00:00 2001 From: Sergio Date: Thu, 5 Sep 2013 00:40:14 +0200 Subject: 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]) --- guides/source/active_record_querying.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'guides') 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. -- cgit v1.2.3