Skip to content

Commit

Permalink
Make exceptions raise from find_by_foo! have a more helpful message [#…
Browse files Browse the repository at this point in the history
…1567 state:resolved]
  • Loading branch information
fcheung authored and lifo committed Dec 18, 2008
1 parent a9fde9a commit 428e77b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/base.rb
Expand Up @@ -1829,7 +1829,7 @@ def self.#{method_id}(*args)
else
find(:#{finder}, options.merge(finder_options))
end
#{'result || raise(RecordNotFound)' if bang}
#{'result || raise(RecordNotFound, "Couldn\'t find #{name} with #{attributes.to_a.collect {|pair| "#{pair.first} = #{pair.second}"}.join(\', \')}")' if bang}
end
}, __FILE__, __LINE__
send(method_id, *arguments)
Expand Down

0 comments on commit 428e77b

Please sign in to comment.