thanks Marnen. this is exactly what i as looking for. Your answer is informative and it explains why i should avoid writing sqls in it. thanks again.
-radha. Marnen Laibow-Koser wrote: > RailsFan Radha wrote: > [...] >> What is the bext practice in this case? (Yes, I always want to show the >> active records only ). >> Using find_by_sql or using a condition in the find :all ? ( I like SQLs, >> but as far as the performance goes which approach is better? ) > > The performance is probably equivalent. The maintainability, however, > is not. find_by_sql locks your code to one DB server and makes it less > maintainable. *Do not* use find_by_sql unless you have no other choice > -- write your code with ActiveRecord find syntax whenever possible. > >> >> >> Can someone throw light in this please? >> >> - thanks > > 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.

