I have a hierarchical database structure where University > College >
Department > Course, and I want to select several Course objects for a
certain University. I am achieving this now with a find() function that
looks like this:
courses = Db::Course.find(:all, :include => {:department => {:school =>
:university}},
:conditions => ["university.title = ?",
''Stanford''],
:select => "course.code, course.id, department.code")
My query works, but the select clause doesn''t have any effect... it
doesn''t show up in the query no matter what it is, and crazy values
like
''SDFASDF asdfASD FASD A'' do not raise a database error.
It is wasteful for me to select all the data from the joins when all I
needed some of them for was to process certain conditions. It is a very
fast database operation no matter what but with large sets of data Ruby
is slow to load the whole response.
am I don''t something wrong, or does activerecord need a fix?
thanks sincerely,
Red Daly
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---