if you use find_by_name you have to catch the case it's nil. Better use get_by and have the framework handle the exception