[jifty-devel] Jifty-DBI: Question about the Jifty::DBI::Collection->unlimit method

Jesse Vincent jesse at bestpractical.com
Thu Oct 19 14:56:53 EDT 2006

On Thu, Oct 19, 2006 at 08:51:54PM +0200, Frederic BLANC wrote:
>  Hello,
>  I do not understand why the unlimit method do a $self->limit(-1) call?
> For me -1 is a true value, so this call means that the unlimit method
> makes the Collection... limited? :-\

It's not a "limit(-1)" but:


In JDBI, collections default to an empty set. You need to explicitly
say: "I want to find all rows."

The search routines look for this like this:

    return 0 unless ( $self->_is_limited );

So. -1 says "yes, it's limited" but not "limited to something"

We intend to correct "limit" to "find" or something like that.

"unlimit" would become "find_all".

>  Best regards,
>  Frederic BLANC
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel


More information about the jifty-devel mailing list