Is there a way of doing a find_by_x that raises an exception if the record is not found?
+2
A:
added "!" at the end:
User.find_by_name "a" => return nil
User.find_by_name! "a" => raise error
amikazmi
2009-09-09 15:44:07