Displaying 1 result from an estimated 1 matches for "handle_the_error".
2006 Apr 24
1
A question of style - save vs. save!
A pseudo poll on AR error handling...
With AR, you have the choice between the following:
(1)
if thing.save
go_for_it
else
handle_the_error
end
(2)
begin
thing.save!
rescue RecordInvalid => error
handle_the_error
end
(3)
override rescue_action_in_public (ala the recipes book)
or do something homegrown, and then just
thing.save!
---
The questions are:
-Which idiom do you use and why?
-Are you consistent across your app/contro...