This forum has been very helpful in the past so I figured I’d try and
ask for some help on some (yet again) rather “newbie” stuff again.
I currently have the following DB Schema (Two Tables Listed here):
Users Table (user has_many children)
Children Table (children belongs_to user)
Users Controller show method:
@user = User.find_by_login(params[:id])
@lost_children = @user.children.find(:all, :conditions => “is_lost =
This WORKS. However, I’m sure I can cut down doing a find query by doing
something like this:
@lost_children = @user.children(:is_lost => true)
The above doesn’t work for me (as I just made it up out of the blue).
But there must be something of this nature that can aid in avoiding
making another DB call. I’ve tried searching for a while now but have
had little luck.
At the very least, any suggestions on how to make that code
Many thanks in advance!
P.S. Please let me know if you need more code or explanations.