Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Bounded params in find(...:from)

#12

Add the ability to pass in bounded parameters in the :from part of a find call. This is useful for selecting from a db function or stored procedure which needs parameters from input which is possibly tainted.

http://github.com/danbarry/rails...

Reported by Dan Barry · April 16th, 2008 @ 07:42 PM

State: invalid
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Dan Barry
    Dan Barry

    My tests look worse and worse every time I see them, but I can't think of a way to make them clearer without writing (and testing in every supported db) a db function that simply returns all of the rows from a table. Should I do that or can anyone think of a better way to test this?

    April 17th, 2008 @ 04:04 PM

  2. John Barnette
    John Barnette
    • Title changed from [PATCH] bounded params in find(...:from) to Bounded params in find(...:from)

    April 22nd, 2008 @ 08:25 AM

  3. Dan Barry
    Dan Barry

    Oops, I deleted my github fork while I still had an outstanding patch. Ignore the link in my comment and instead scroll down to the link to the patch on the bottom right.

    May 1st, 2008 @ 05:06 PM

  4. Kyle Hargraves
    Kyle Hargraves

    +1, tests pass, and I've been using this in production for a while. It makes it much cleaner to call database functions from within AR without having to go through find_by_sql.

    May 1st, 2008 @ 05:20 PM

  5. Pratik
    Pratik
    • State changed from new to invalid

    The patch doesn't apply cleanly anymire.

    I think it'll be a good idea to discuss this patch/feature in the core mailing list.

    Thanks.

    May 11th, 2008 @ 11:20 PM