[Jifty-commit] r5484 - in Jifty-DBI/trunk: . lib/Jifty/DBI

Jifty commits jifty-commit at lists.jifty.org
Sat May 24 23:33:31 EDT 2008


Author: jasonmay
Date: Sat May 24 23:33:30 2008
New Revision: 5484

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

Log:
 r10232 at culex:  jasonmay | 2008-05-24 23:30:43 -0400
 collections can now clear_order_by


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	Sat May 24 23:33:30 2008
@@ -1556,6 +1556,18 @@
     return ( $self->{'order_by'} || [] );
 }
 
+=head2 clear_order_by
+
+Clears whatever would normally get set in the ORDER BY clause.
+
+=cut
+
+sub clear_order_by {
+    my $self = shift;
+
+    $self->{'order_by'} = [];
+}
+
 =head2 _order_clause
 
 returns the ORDER BY clause for the search.

Modified: Jifty-DBI/trunk/t/13collection.t
==============================================================================
--- Jifty-DBI/trunk/t/13collection.t	(original)
+++ Jifty-DBI/trunk/t/13collection.t	Sat May 24 23:33:30 2008
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 7;
+use Test::More tests => 8;
 
 my $package;
 BEGIN { 
@@ -123,3 +123,5 @@
    ' ORDER BY ab.msg_id DESC, main.yaks ASC ',
    "add_order_by works when passing a list-as-hash directly";
 
+$obj->clear_order_by;
+is($obj->_order_clause, '', "clear_order_by works");


More information about the Jifty-commit mailing list