[Jifty-commit] r2282 - Jifty-DBI/trunk/lib/Jifty/DBI

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sun Dec 3 02:39:29 EST 2006


Author: audreyt
Date: Sun Dec  3 02:39:29 2006
New Revision: 2282

Modified:
   Jifty-DBI/trunk/lib/Jifty/DBI/Collection.pm

Log:
* Jifty::DBI::Collection - The "function" argument to the "column" method
  was broken when passed with trailing "?" characters.
* Also clean up the documentation about ->distinct_required.

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	Sun Dec  3 02:39:29 2006
@@ -579,18 +579,20 @@
 
 Returns true if Jifty::DBI expects that this result set will end up
 with repeated rows and should be "condensed" down to a single row for
-each unique primary key.  Out of the box, this method returns true if
-you've joined to another table.  If you're smarter than Jifty::DBI,
-feel free to override this method in your subclass.
+each unique primary key.
 
-XXX TODO: it should be possible to create a better heuristic than the simple "is it joined?" question we're asking now. Something along the lines of "are we joining this table to something that is not the other table's primary key"
+Out of the box, this method returns true if you've joined to another table.
+To add additional logic, feel free to override this method in your subclass.
+
+XXX TODO: it should be possible to create a better heuristic than the simple
+"is it joined?" question we're asking now. Something along the lines of "are we
+joining this table to something that is not the other table's primary key"
 
 =cut
 
 sub distinct_required {
     my $self = shift;
-    return $self->_is_joined ? 1 : 0;
-
+    return( $self->_is_joined ? 1 : 0 );
 }
 
 =head2 build_select_count_query
@@ -1660,7 +1662,7 @@
 
         # If we want to substitute
         elsif ( $func =~ /\?/ ) {
-            $name = CORE::join( $name, split( /\?/, $func ) );
+            $name =~ s/\?/$name/g;
         }
 
         # If we want to call a simple function on the column


More information about the Jifty-commit mailing list