On 10/8/07, Nik Nik
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
> HI, I''ve read the basic books about ROR and even skimmed the
recipes
> book but can''t find a standard path for my problem.
> I''ve to show data that due to relationships is going to take more
> tables, not one or two but 6/7 and even 13 in some cases. Now in other
> languages I usually write a quite long SQL statement and I get what I
> want. But with Rails? Should I work on the model? Should I create a view
> and then a class associated with it? Should I write the same old SQL
> statement?
Well you could try modelling the relationships in ActiveRecord, but I
don''t fully know how far Model.find .... goes in recursing those
relationships.
Ideally you want it all to come back in the one query.
Still if you have that kind of SQL, I think using the raw SQL query is the
best choice. Rails allows you to do this, and even encourages you to
do this when you outgrow what Rails gives you.
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---