[Nitro] Og save
Jonathan Buch
john at oxyliquit.de
Fri Aug 24 14:00:40 EDT 2007
Hi,
> Please note that the implementation of the og save method in the repository
> version is changed from earlier versions. Ie it now uses Exceptions instead
> of the return value to notify possible (verification) problems. The change
> is quite old but I will add some comments in the code to make it more
> visible (even I have forgotten about it ;-)).
I'm not really that fond of that change, as I see the occurance of a validation
error as not something exceptional but as an 'expected' route and thus see
a exception as overkill.
begin
obj.save
rescue Og::ValidationError
# do stuff
end
if !obj.save
# do stuff
end
Of course I also read the discussion where that change stems from, and I
agree that it might confuse some people who do `obj.save` and nothing
happens in the db....
Just my piece of mind,
Jo
--
Feel the love
http://pinkjuice.com/pics/ruby.png
More information about the Nitro-general
mailing list