Forum: Ruby on Rails find_or_create_by_name

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.
Fresh M. (Guest)
on 2008-12-11 18:17
If I have a table: (id, lastname, firstname), can I use
"find_or_create_by_name" if I have to search by first and last name?
Frederick C. (Guest)
on 2008-12-11 18:23
(Received via mailing list)
On 11 Dec 2008, at 16:17, Gi Ga wrote:

>
> If I have a table: (id, lastname, firstname), can I use
> "find_or_create_by_name" if I have to search by first and last name?

no. find_or_create_by_foo requires foo to be an actual column (but you
can do find_or_create_by_foo_and_bar)

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