Hello, I''m interested in functionality that links the ease of use of find with the control offered by find_by_sql. In my case, I''m doing what would normally be a simple find but with a calculation thrown in. What I propose is two things 1. A method of adding this calculation to the generated SQL. The :select option seems to be close to what I want. Perhaps something like :custom_select which will be appended to the rest of the select statement? 2. A method of accessing the raw rows that are read from the DB. Looking at the internals of rails, I see at least for the associations case the raw rows are readily available. Just need a way to get at them. Thoughts? - Jeff _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Friday 16 September 2005 11:06, Jeff Lee wrote:> What I propose is two things> 2. A method of accessing the raw rows that are read from the DB. > Looking at the internals of rails, I see at least for the > associations case the raw rows are readily available. Just need a way > to get at them.http://dev.rubyonrails.org/ticket/2172 This patch, among other things, adds an option to find to set the type of the result. With :result => :arrays you get an array per result row. Michael -- Michael Schuerig The Fifth Rider of the Apocalypse mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org is a programmer. http://www.schuerig.de/michael/