[Jifty-commit] r2009 - in jifty/trunk: lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Tue Oct 10 00:33:09 EDT 2006


Author: jesse
Date: Tue Oct 10 00:33:09 2006
New Revision: 2009

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

Log:
 r28331 at pinglin:  jesse | 2006-10-10 00:08:49 -0400
 * Better handling of current_user when used as a class method


Modified: jifty/trunk/lib/Jifty/Object.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Object.pm	(original)
+++ jifty/trunk/lib/Jifty/Object.pm	Tue Oct 10 00:33:09 2006
@@ -29,6 +29,9 @@
 
 sub current_user {
     my $self = shift;
+    unless (ref($self)) {
+        Carp::cluck("Called current_user as a class method. Dealing. Fix your code.");
+    }
     $self->{'_current_user'} = shift if (@_); 
     return($self->{'_current_user'});
 }
@@ -49,7 +52,7 @@
     my $self = shift;
     my %args = (@_);
 
-    return if ( $self->current_user );
+    return if ( ref($self) && $self->current_user );
 
     if ( $args{'current_user'} ) {
         return $self->current_user( $args{'current_user'} );


More information about the Jifty-commit mailing list