On 9 May 2010 17:26, Edwin <[email protected]> wrote:
> How can I output the OrganizationType's description from the
> @organizations variable without a query being executed for each row in
> the list?

You can use the ":include" option of AR to eager-load relationships:
http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002263

> I have just started using rails

Welcome! :-)
I'd suggest not to worry too much (at this stage) about which queries
are being executed when. While learning, I'd just focus on the
higher-level operations of the framework.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to