Skip to content
Browse files

Docs: Fixed bad exists? documentation.

Base#exists? does not actually take options like finder methods. Trying
to use what the documentation suggests will return a PG error because it
will look for a column named 'conditions'.

I changed the documentation to reflect how the exists? method actually
works.
  • Loading branch information...
1 parent 7763f39 commit d61f83dd304cebbf836d2808fe0141675fae1430 @kwstannard committed Feb 5, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 railties/guides/source/active_record_querying.textile
View
5 railties/guides/source/active_record_querying.textile
@@ -867,10 +867,11 @@ Client.exists?(1,2,3)
Client.exists?([1,2,3])
</ruby>
-Further more, +exists+ takes a +conditions+ option much like find:
+Further more, +exists+ takes a hash or array like what you would pass into a +conditions+ option:
<ruby>
-Client.exists?(:conditions => "first_name = 'Ryan'")
+Client.exists?(:first_name => 'Ryan')
+Client.exists?(['first_name = ?', 'Ryan'])
</ruby>
It's even possible to use +exists?+ without any arguments:

0 comments on commit d61f83d

Please sign in to comment.
Something went wrong with that request. Please try again.