[Jifty-commit] r650 -

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Fri Mar 3 19:03:25 EST 2006


Author: jesse
Date: Fri Mar  3 19:03:23 2006
New Revision: 650

Modified:
   /   (props changed)
   jifty/trunk/lib/Jifty/Record.pm

Log:
 r25148 at truegrounds:  jesse | 2006-03-03 11:27:53 -0800
 * When we can, pass in a currentuser, rather than using the convenience method that goes code-diving


Modified: jifty/trunk/lib/Jifty/Record.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Record.pm	(original)
+++ jifty/trunk/lib/Jifty/Record.pm	Fri Mar  3 19:03:23 2006
@@ -80,6 +80,16 @@
 }
 
 
+=head2 primary_key
+
+Returns the default primary key for record columns: 'id'.
+This routine short-circuits a much heavier call up through Jifty::DBI
+
+=cut
+
+sub primary_key {'id'}
+
+
 =head2 load_or_create
 
 Attempts to load a record with the named parameters passed in.  If it
@@ -286,11 +296,11 @@
 
     return unless defined $value;
     return undef unless $classname;
-    return unless UNIVERSAL::isa( $classname, 'Jifty::DBI::Record' );
+    return unless UNIVERSAL::isa( $classname, 'Jifty::Record' );
 
     # XXX TODO FIXME we need to figure out the right way to call new here
     # perhaps the handle should have an initiializer for records/collections
-    my $object = $classname->new();
+    my $object = $classname->new(current_user => $self->current_user);
     $object->load_by_cols(( $column->by || 'id')  => $value);
     return $object;
 }


More information about the Jifty-commit mailing list