[Jifty-commit] r3541 - in Jifty-DBI/trunk: lib/Jifty/DBI/Filter lib/Jifty/DBI/Record

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed Jun 20 18:42:42 EDT 2007


Author: sterling
Date: Wed Jun 20 18:42:41 2007
New Revision: 3541

Modified:
   Jifty-DBI/trunk/   (props changed)
   Jifty-DBI/trunk/lib/Jifty/DBI/Filter/Truncate.pm
   Jifty-DBI/trunk/lib/Jifty/DBI/Record/Cachable.pm

Log:
 r7752 at riddle:  andrew | 2007-06-20 17:40:37 -0500
 Added recognition of Jifty::DBI::Record links in _gen_record_cache_key to resolve a problem with the wrong record being returned when passing a record object to load_by_cols on cachable records.


Modified: Jifty-DBI/trunk/lib/Jifty/DBI/Filter/Truncate.pm
==============================================================================

Modified: Jifty-DBI/trunk/lib/Jifty/DBI/Record/Cachable.pm
==============================================================================
--- Jifty-DBI/trunk/lib/Jifty/DBI/Record/Cachable.pm	(original)
+++ Jifty-DBI/trunk/lib/Jifty/DBI/Record/Cachable.pm	Wed Jun 20 18:42:41 2007
@@ -5,6 +5,7 @@
 use Jifty::DBI::Handle;
 
 use Cache::Simple::TimedExpiry;
+use Scalar::Util qw/ blessed /;
 
 use strict;
 use warnings;
@@ -268,6 +269,9 @@
       push @cols, lc($key) . ( $value->{operator} || '=' )
           . defined $value->{value}? $value->{value}: '__undef';
     }
+    elsif ( blessed $value and $value->isa('Jifty::DBI::Record') ) {
+      push @cols, lc($key) . '=' . ( $value->id );
+    }
     else {
       push @cols, lc($key) . "=" . $value;
     }


More information about the Jifty-commit mailing list