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

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Tue Aug 8 23:22:07 EDT 2006


Author: zev
Date: Tue Aug  8 23:22:07 2006
New Revision: 1780

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

Log:
 r16352 at galvatron:  zev | 2006-08-08 23:21:51 -0400
 * make passing a J:D:Collection as a value DTRT


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	Tue Aug  8 23:22:07 2006
@@ -663,7 +663,9 @@
 
 =item value
 
-Should always be set and will always be quoted. 
+Should always be set and will always be quoted.  If the value is a
+subclass of Jifty::DBI::Object, the value will be interpreted to be
+the object's id.
 
 =item operator
 
@@ -732,6 +734,11 @@
     croak "Must provide a value to limit to"
         unless defined $args{value};
 
+    # make passing in an object DTRT
+    if (ref($args{value}) && $args{value}->isa('Jifty::DBI::Record')) {
+        $args{value} = $args{value}->id;
+    }
+
     #since we're changing the search criteria, we need to redo the search
     $self->redo_search();
 


More information about the Jifty-commit mailing list