Yes, you've pretty much got it. Though I realize I wasn't very clear
about what I meant about loading the ids.
What I meant to suggest was that rubyamf would lazy load associations
the same way activerecord lazy loads associations. So for each
belongs_to association, rubyamf would only get the id for the
associated object. For has_many associations, rubyamf would not load
any data, unless specified with an :include option.
Also the eager loading performed by rubyamf results in lots of dreaded
1+N queries. If I do the following in my controller:
@projects = Project.find(:all, :include => :notes)
Rails generates one query it titles "Project Load Including
Associations" in the debug output. The single sql query has JOIN on
the notes table. If I then follow this eager loading with
format.xml { render :xml => @projects.to_xml(:include => :notes) }
No additional queries are run, and the notes are part of the XML
output. However if I do the following:
format.amf { render :amf => @projects }
I get additional queries run for every single notes association (even
though I've already eager loaded the data). I'm assuming this has
something to do with how rubyamf is serializing the data. If there's
an option to get rubyamf to use the eager loaded data through the 1
JOIN query, then I might not even need the lazy load option, since it
seems the bigger bottleneck is the performance of all the 1+N
queries.