This project is archived and is in readonly mode.

#1567 ✓resolved
Zach Dennis

find_by_xxx! bang method, have better error messages

Reported by Zach Dennis | December 12th, 2008 @ 09:49 PM | in 2.x

It would be nice if the find_by_xxx! bang methods gave nicer error messages. Right now you get:


> Expense.find_by_amount(10)
=> nil
>> Expense.find_by_amount!(10)
ActiveRecord::RecordNotFound: ActiveRecord::RecordNotFound

It would be better if the error produced was:


ActiveRecord::RecordNotFound: no Expense found with amount => 10

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Referenced by

Pages