[Nitro] Og save

Jonathan Buch john at oxyliquit.de
Fri Aug 24 14:00:40 EDT 2007


> 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.

rescue Og::ValidationError
   # do stuff

if !obj.save
   # do stuff

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,


Feel the love

More information about the Nitro-general mailing list