提交 d61f83dd 编写于 作者: K Kelly Stannard

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.
上级 7763f39a
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册