[Jifty-commit] r6283 - Jifty-DBI/branches/tisql-joins-refactoring/lib/Jifty/DBI

Jifty commits jifty-commit at lists.jifty.org
Mon Feb 2 06:54:12 EST 2009


Author: ruz
Date: Mon Feb  2 06:54:11 2009
New Revision: 6283

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

Log:
* prefix has been renamed earlier

Modified: Jifty-DBI/branches/tisql-joins-refactoring/lib/Jifty/DBI/Tisql.pm
==============================================================================
--- Jifty-DBI/branches/tisql-joins-refactoring/lib/Jifty/DBI/Tisql.pm	(original)
+++ Jifty-DBI/branches/tisql-joins-refactoring/lib/Jifty/DBI/Tisql.pm	Mon Feb  2 06:54:11 2009
@@ -137,30 +137,30 @@
     die "left hand side must be always column specififcation"
         unless ref $condition->{'lhs'} eq 'HASH';
 
-    my $prefix = $condition->{'prefix'};
+    my $modifier = $condition->{'modifier'};
     my $op     = $condition->{'op'};
     my $long   = do {
         my @tmp = split /\./, $condition->{'lhs'}{'string'};
         @tmp > 2 ? 1 : 0
     };
-    if ( $long && !$prefix && $op =~ $re_negative_op ) {
-        $prefix = 'has no';
+    if ( $long && !$modifier && $op =~ $re_negative_op ) {
+        $modifier = 'has no';
         $op = $invert_op{ lc $op };
     }
-    elsif ( $prefix && !$long ) {
+    elsif ( $modifier && !$long ) {
         die "'has no' and 'has' prefixes are only applicable on columns of related records";
     }
-    $prefix ||= 'has';
+    $modifier ||= 'has';
 
     my $bundling = $long && !$join && $self->{'joins_bundling'};
     my $bundled = 0;
     if ( $bundling ) {
-        my $bundles = $self->{'cache'}{'condition_bundles'}{ $condition->{'lhs'}{'string'} }{ $prefix } ||= [];
+        my $bundles = $self->{'cache'}{'condition_bundles'}{ $condition->{'lhs'}{'string'} }{ $modifier } ||= [];
         foreach my $bundle ( @$bundles ) {
             my %tmp;
             $tmp{$_}++ foreach map refaddr($_), @$bundle;
             my $cur_refaddr = refaddr( $condition );
-            if ( $prefix eq 'has' ) {
+            if ( $modifier eq 'has' ) {
                 next unless $parser->fsolve(
                     $self->{'tisql'}{'conditions'},
                     sub {
@@ -189,7 +189,7 @@
         push @$bundles, [ $condition ] unless $bundled;
     }
 
-    if ( $prefix eq 'has' ) {
+    if ( $modifier eq 'has' ) {
         my %limit = (
             subclause        => 'tisql',
             leftjoin         => $join,
@@ -409,7 +409,7 @@
 
 
     my $op = $condition->{'op'};
-    if ( $condition->{'prefix'} && $condition->{'prefix'} eq 'has no' ) {
+    if ( $condition->{'modifier'} && $condition->{'modifier'} eq 'has no' ) {
         die "'has' and 'has no' prefixes are only allowed in query, not in joins";
     }
 


More information about the Jifty-commit mailing list