RailsCasts Pro episodes are now free!

Learn more or hide this

Maksim Baev's Profile

GitHub User: mbaev

Site: http://mbaev.com

Comments by Maksim Baev

Avatar

find_by will return only one row, while find_all_by (not find_by_all) returns all of found records.
But now find_all_by is deprecated and you need to use where. Example:

Ruby
Example.find_all_by_published(true)
# should be replaced with 
Example.where(published: true)