Colin Law wrote in post #972572: > On 5 January 2011 17:38, Fernando Leandro > <[email protected]> wrote: >> >> >> FROM courses >> >> I know that this question is not about rails but i need to solve this >> problem to continue my rails app, >> and i would appreciate if someone could help me.. > > You can make it a Rails question by re-formulating the question in > terms of your ActiveRecord relationships and asking how to code a find > operation to return the objects you want. In practice this should be > your initial approach anyway, only resorting to SQL if you cannot code > it using Rails helpers.
Agreed -- mostly. I'm very comfortable with SQL, so I often find it helpful to consider a query in SQL terms first, and then figure out how to abstract that SQL with ActiveRecord. That usually leads to better queries anyway -- ActiveRecord can be ridiculously inefficient for certain operations. > > Colin Best, -- Marnen Laibow-Koser http://www.marnen.org [email protected] -- 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 [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.

