Re: How To Avoid Loading Associated Objects When I Know Their ID
I'm not sure if this is the best way, but sometimes i use
"non-updatable relationships" for one-to-one relationships where the ids
are in a known set of possibilities. I can't remember the proper
Try using load(1) instead of get(1). I haven't done sql logging to
confirm that it avoids a DB call, but the documentation suggests
that it'll save you a trip to the database if all you're using is
the id of the object.