diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-08-30 23:33:46 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-08-30 23:45:03 +0100 |
commit | d0720ad5f8c49fdca103babf5f3d9df1aaae3af2 (patch) | |
tree | fedf7de445d56611472425ac5054cf7f7c2ecaad | |
parent | ceca3a0564000024e2bbb273a431c3063f2011c5 (diff) | |
download | rails-d0720ad5f8c49fdca103babf5f3d9df1aaae3af2.tar.gz rails-d0720ad5f8c49fdca103babf5f3d9df1aaae3af2.tar.bz2 rails-d0720ad5f8c49fdca103babf5f3d9df1aaae3af2.zip |
Reword the section about exists?
-rw-r--r-- | railties/guides/source/active_record_querying.textile | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/railties/guides/source/active_record_querying.textile b/railties/guides/source/active_record_querying.textile index aa837f7ddf..2451773990 100644 --- a/railties/guides/source/active_record_querying.textile +++ b/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? |