Phlip wrote: >> "Nothing that looks at all like SQL should go into a controller, view, >> or helper." > > Things that "look like" SQL include any kind of query more elaborate than a > simple accessor call.
I just read _all_ of Fowler's statement. Helpers are a gray area. In software design, there is the concept of breaking up low-level coupling by escalating dependencies. If you have a statement that goes A.elaborate_query.b.elaborate_query, then does your query belong inside Model A or B? The cheap answer is "pick one at random and keep coding!" The more elaborate answer is if A was decoupled from B we might not want to couple it, so putting the query into a helper makes more sense. (It's also quite testable there...;) -- Phlip http://flea.sourceforge.net/resume.html --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---