Forum: Ruby on Rails Table.exists?() returning false

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Oliver D. (Guest)
on 2007-02-20 20:58
I'm trying to use the .exists?() method in a rails application to detect
if name='blah' exists in a row or not.  According to the documentation
this would be
 Person.exists?(:name => "David")

However this always returns false for me.  If I only look for the row ID
it works just fine.
 Person.exists?(5)

I've reverted to a more manual approach but feel like this should work.
Has anyone made this work as documented?  Is this a known bug?

Oliver
This topic is locked and can not be replied to.