Hi guys,
I have a situation where I''m performing a find(:all) and loading
additional models
in via :include, but the relationship that describes is a one-to-zero-or-one.
During the template rendering, if I perform a my_model.other_model.nil? query,
and the eagre loading *didn''t* find a corresponding row in
"other_model", it forces
another database query ("SELECT * FROM other_models WHERE fk = n LIMIT
1") just
to prove it''s really a one-to-zero relationship.
Is there a way of testing the optional model being present without it needing to
query the DB again?
Thanks,
Nick