Rails: Why does find_by not work on my ActiveRecord model?

Posted by randombits on Stack Overflow See other posts from Stack Overflow or by randombits
Published on 2010-06-18T00:39:11Z Indexed on 2010/06/18 0:43 UTC
Read the original article Hit count: 230

Filed under:
|

I have a simple model named Foo.

Foo has two columns, bar and foobar.

Doing a simple Foo.find_by_bar("a") is returning nil. There is a record in the table where bar contains a. Also, what's even more troubling, is I don't see the query even happening in the development log.

A simple Foo.find(1) works though.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby