[Jifty-commit] r5866 - in Jifty-DBI/trunk: lib/Jifty/DBI

Jifty commits jifty-commit at lists.jifty.org
Fri Sep 19 18:59:46 EDT 2008


Author: ruz
Date: Fri Sep 19 18:59:41 2008
New Revision: 5866

Modified:
   Jifty-DBI/trunk/   (props changed)
   Jifty-DBI/trunk/lib/Jifty/DBI/Collection.pm

Log:
 r5885 at cubic-pc:  cubic | 2008-09-19 04:46:45 +0400
 * call ->table for defaulting only when we actually want defaulting


Modified: Jifty-DBI/trunk/lib/Jifty/DBI/Collection.pm
==============================================================================
--- Jifty-DBI/trunk/lib/Jifty/DBI/Collection.pm	(original)
+++ Jifty-DBI/trunk/lib/Jifty/DBI/Collection.pm	Fri Sep 19 18:59:41 2008
@@ -1170,10 +1170,10 @@
 sub limit {
     my $self = shift;
     my %args = (
-        table            => $self->table,
+        table            => undef,
+        alias            => undef,
         column           => undef,
         value            => undef,
-        alias            => undef,
         quote_value      => 1,
         entry_aggregator => 'or',
         case_sensitive   => undef,
@@ -1200,7 +1200,7 @@
     unless ( defined $args{'alias'} ) {
 
         #if the table we're looking at is the same as the main table
-        if ( $args{'table'} eq $self->table ) {
+        if ( !defined $args{'table'} || $args{'table'} eq $self->table ) {
 
             # TODO this code assumes no self joins on that table.
             # if someone can name a case where we'd want to do that,


More information about the Jifty-commit mailing list