Topic: Best way to pre-load all records of a model?
For example, imagine a Tree model representing a tree of nodes, like navigation. It's a reasonable size, so I just want to shove the whole thing into memory and not worry about it. What's the best way to do this? For example, if I have an article and call article.node, it wouldn't know to use pre-loaded data.
What I've tried is to just shove the whole thing into a global variable, and always do manual lookups by ID into it, but there's gotta be a cleaner way to do this?