Fix failure case when `where` returns nil and calling #first give no method error. Solution is to replace with find_by.