[Nitro] request params -> action params

George Moschovitis george.moschovitis at gmail.com
Fri Sep 1 10:42:24 EDT 2006

Ahem, thanks for the  detailed bug report, I will go back tou the
drawing board. Btw,
a related tc_xxx test case file would be extremely helpful ;-) ;-)


On 9/1/06, Jonathan Buch <john at oxyliquit.de> wrote:
> Hi,
> > I made some changes to the way the request uri parameters are
> > converted to action parameters. I am wondering if these changes fix an
> > older reported bug. It does work more reliabbly for me (and the
> > implementation is a lot cleaner).
> this patch doesn't fix the previous bug, in fact it makes it worse.
> def update(oid = nil)
> end
> If you try that, you'll see that it never works, that it gets filled
> with nil in any case.  Like your comment above the code says, there are
> negative numbers in case there are parameters which are optional.
> * positive numbers are normal, non optional parameters
> * zero is for no parameters
> * -1 always specifies 0 or more parameters
>    def a(b = nil); end
>    def a(*args); end
>    def a(b=nil, c=nil); end
>    etc.
> * below -1, (arity.abs - 1) non optional parameters, at least one
>    optional parameter.
> * Other wierd stuff I found:
>    def a(c, b=nil, &d); end # => arity 2
> Since that param bug was introduced, I have as a workaround *args at
> the end of the problematic actions (insert/update).
> Well, what I'm saying is:  One has to be very careful with that param
> stuff, as it's quite non-trivial and can kill any webapp.
> If you want me to, I can throw tests at you while you are searching
> for a correct implementation.  Information I would need is how to send
> POST requests as well as GET requests (as that isn't shown in the test
> suite of compiler.rb).
> I'm not sure what the ideal implementation would be... maybe to disable
> parameter injection when it got already (partly) filled by a nice-url?
> I'm not sure what to do with half-filled actions, as they 'should'
> raise errors, but the error handling should be application specific..
> Sorry for the rant.
> Jo
> --
> Feel the love
> http://pinkjuice.com/pics/ruby.png
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general


More information about the Nitro-general mailing list