[Jifty-commit] r6690 - Jifty-DBI/branches/tisql/lib/Jifty/DBI

Jifty commits jifty-commit at lists.jifty.org
Fri Mar 20 22:14:18 EDT 2009


Author: ruz
Date: Fri Mar 20 22:14:17 2009
New Revision: 6690

Modified:
   Jifty-DBI/branches/tisql/lib/Jifty/DBI/Tisql.pm

Log:
* simplify apply_query_tree

Modified: Jifty-DBI/branches/tisql/lib/Jifty/DBI/Tisql.pm
==============================================================================
--- Jifty-DBI/branches/tisql/lib/Jifty/DBI/Tisql.pm	(original)
+++ Jifty-DBI/branches/tisql/lib/Jifty/DBI/Tisql.pm	Fri Mar 20 22:14:17 2009
@@ -148,25 +148,18 @@
 
     $collection->open_paren('tisql');
     foreach my $element ( @$tree ) {
-        unless ( ref $element ) {
-            $ea = $element;
-            next;
-        }
         elsif ( ref $element eq 'ARRAY' ) {
             $self->apply_query_tree( $element, $ea );
-            next;
         }
-        elsif ( blessed $element && $element->isa( 'Jifty::DBI::Tisql::Condition' ) ) {
+        elsif ( ref $element ) {
             $self->apply_query_condition( $collection, $ea, $element );
         }
-        elsif ( ref $element eq 'HASH' ) {
-            Carp::confess( "booo" );
-            $self->apply_query_condition( $collection, $ea, $element );
-        } else {
-            die "wrong query tree ". Dumper( $element, $tree );
+        else {
+            $ea = $element;
         }
     }
     $collection->close_paren('tisql');
+    return $self;
 }
 
 sub apply_query_condition {


More information about the Jifty-commit mailing list