None of the methods are deprecated (as far as I know). The difference between find and find_by() is that they return when the record does not exist. If the record with id 23 does not exist, this is what you get:
Model.find(23) => ActiveRecord::RecordNotFound: Couldn't find Model with 'id'=23
or
Model.find_by(id: 23) => nil
Using find_by more forgiving if you make queries where a nonexistent entry exists, because you get a nil value, not an exception.
source share