Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Reword the section about exists?

  • Loading branch information...
commit d37a44e42c7d42ff7f04c1bbc54a6ee64c8081bf 1 parent c1915f5
@lifo lifo authored fxn committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 railties/guides/source/active_record_querying.textile
View
6 railties/guides/source/active_record_querying.textile
@@ -838,13 +838,13 @@ Client.exists?(1,2,3)
Client.exists?([1,2,3])
</ruby>
-The +exists+ method may also take a +conditions+ option much like find:
+It's even possible to use +exists?+ without any arguments on a model or a relation.
<ruby>
-Client.exists?(:conditions => "first_name = 'Ryan'")
+Client.where(:first_name => 'Ryan').exists?
</ruby>
-It's even possible to use +exists?+ without any arguments:
+The above returns +true+ if there is at least one client with the +first_name+ 'Ryan' and +false+ otherwise.
<ruby>
Client.exists?
Please sign in to comment.
Something went wrong with that request. Please try again.