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

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sun Jan 28 08:34:47 EST 2007


Author: jesse
Date: Sun Jan 28 08:34:47 2007
New Revision: 2680

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

Log:
 r21608 at hualien:  jesse | 2007-01-28 21:31:51 +0800
 * Added the 'bootstrap' option to vanilla Jifty::CurrentUser. Now there's one fiewer cases where you need a custom CurrentUser class


Modified: jifty/trunk/lib/Jifty/CurrentUser.pm
==============================================================================
--- jifty/trunk/lib/Jifty/CurrentUser.pm	(original)
+++ jifty/trunk/lib/Jifty/CurrentUser.pm	Sun Jan 28 08:34:47 2007
@@ -38,9 +38,11 @@
 
 sub new {
     my $class = shift;
-    my $self = {};
+    my $self  = {};
     bless $self, $class;
-    $self->_init(@_);
+    my %args = (@_);
+    if ( delete $args{'_bootstrap'} ) { $self->is_bootstrap_user(1); }
+    $self->_init(%args);
     return $self;
 }
 
@@ -72,9 +74,7 @@
 	    my $self = shift;
 	    my %args = (@_);
 	
-	    if (delete $args{'_bootstrap'} ) {
-	        $self->is_bootstrap_user(1);
-	    } elsif (keys %args) {
+            if (keys %args) {
 	        $self->user_object(Wifty::Model::User->new(current_user => $self));
 	        $self->user_object->load_by_cols(%args);
 	    }


More information about the Jifty-commit mailing list