[Nitro] Roadmap 0.40

Jonathan Buch john at oxyliquit.de
Fri Nov 3 08:28:27 EST 2006


> nope these patches are needed. For example they fix a common bug.
> Consider this code:
> def save_article
>   a = Article.new.assign(request)
>   a.author = User.current
>   a.something_else = 'initialize something else'
>   a.save
> end
> without the patch Og saves behind the scenes the article before
> 'something_else' is initialized. Moreover it also saves the user. Both
> queries are not needed and break this example.
> Am I missing something?

Not sure, I've been thinking about this a bit more.

Using your example:

If User.current is a not saved yet, has no oid, then this will fail.

Please describe that 'something_else' which has to be initialized before
the Article gets it's oid.

Where I know that your way might be the better one:  In Orderable, which
can be quite ugly if something is or is not saved on some very
constrained condition.

When removing the implicit saves, there have to be explicit .save's all
over the place.  I've seen one example from Rayman where he literarily
saved every other line or it wouldn't work, pretty ugly.

It would be good to have testcases specifying the appropriate behaviour.
Again like with params, this might just be another way of thinking.  :P


More information about the Nitro-general mailing list