[jifty-devel] Jifty::DBI::Collection->unlimit
Kevin Falcone
falcone at bestpractical.com
Tue Jul 31 16:36:17 EDT 2007
On Jul 28, 2007, at 7:28 PM, Jesse Vincent wrote:
>
> On Jul 27, 2007, at 1:35 AM, Mikko Lipasti wrote:
>
>> Hello list,
>>
>>
>> There seems to be a gap between what unlimit does and what the
>> documentation says it does.
>>
>> http://search.cpan.org/dist/Jifty-DBI/lib/Jifty/DBI/
>> Collection.pm#unlimit:
>> "Clears all restrictions and causes this object to return all rows
>> in the primary table."
>>
>> In reality, unlimit calls clean_slate() which does a whole lot
>> more than just removes limits. For instance, it resets order_by().
>>
>> A doc fix would suffice for me, however I find it a bit
>> unfortunate that an unlimit() call doesn't just undo limit() calls
>> as the names (and to an extent, current documentation) would imply.
>>
>
>
> Can you test out this patch and tell me if does what you want? It
> improves the "unlimit" documentation and adds a new "find_all_rows'
> method that has the semantics (I think) you want.
Sadly, as I discovered today, we have code internally that expects to
be able to set up some
joins and wheres ahead of time and still have them apply to an unlimit
().
This code is using Jifty::Collection::implicit_clauses and when they
don't get added, we get
way more results than we expect (mostly problems with trying to do
acl'ing in the DB and limit what
we get back).
I'm not sure if we need to include the implicit stuff separately from
the explicit limit() calls because
I agree that
$collection->limit(...);
$collectioin->unlimit();
should return all the rows, but should also let us do some magic
-kevin
More information about the jifty-devel
mailing list