You really ought to consider rethinking why you need a global variable
like this. Models are meant to stand along and be manipulated through
an independent interface. So although you modify them from a
controller, you can also use them in the console, in unit tests, or
even completely separate ruby programs. Requiring a global variable
instantly places a very specific constraint on all these possible uses.
That said, I see what you're trying to do, but I'm not sure of the best
solution exactly. There must be a clean way to do it, because it's a
cornerstone of 37signals apps. Maybe someone else can explain the best
way to do it.
Michael Wilkes wrote: