1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Reword the section about exists?

This commit is contained in:
Pratik Naik 2010-08-30 23:33:46 +01:00
parent ceca3a0564
commit d0720ad5f8

View file

@ -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?