[...]
> I feel
Programming is ideally about facts, not feelings. (How closely we approach that ideal is another question...)
If only it were that simple I have used books to learn about Rails and I do use the docs alot, but most of the time I'm dealing with people who have very specific needs and it can be very hard to work your way through Rails' naming conventions. Eager loading, for example, is something you will really have to stumble across in a book. And when you know the term, you know where to find it and how to use it. Sometimes you just have to assume certain things and let others correct you if you're wrong.
> making one database request for everything I need is better > than making five, but I've now learned find doesn't work that way.
It can. Use :joins instead of :include.
I've used joins in the past (in my PHP era), but I have a feeling that it doesn't get me the results I want.
The docs mentioned that :joins can be called the same way as :include. Will this work? And will it trigger just one query?
@project = Project.find(:first, :conditions => { :id => params [:id] }, :joins => [:floors) @floors = @project.floors
My guess is that it's not that simple. Especially because what I understand from the MySQL docs, INNER JOIN or CROSS JOIN will generate a new table where rows with matching keys are combined and output its contents. Or would the above work? And would it also work for more complicated examples like the one I posted at 0:27 today?