What\'s the difference between find, where and find_by_id? They all work when you try to find a user given an ID.
find => This return single record if the given primary_key(id) exists in the system otherwise in will give an error.
Model.find(required_id_value)
find_by => This will return single record depends on the given attribute, and if the value of the attribute is not exist in the DB it will return nil.
Model.find_by_name("your name")
name here is the attribute and it must be exist in your Modal.
where => This will return an active record relation with zero or more records you need to use first to return only one record or nil in case zero records return.
Model.where(id: id_value).first