[Catalyst-commits] r14043 - in Catalyst-Authentication-Store-DBIx-Class/trunk: . lib/Catalyst/Authentication/Store/DBIx/Class

hobbs at dev.catalyst.perl.org hobbs at dev.catalyst.perl.org
Fri Jun 17 16:03:55 GMT 2011


Author: hobbs
Date: 2011-06-17 16:03:55 +0000 (Fri, 17 Jun 2011)
New Revision: 14043

Modified:
   Catalyst-Authentication-Store-DBIx-Class/trunk/
   Catalyst-Authentication-Store-DBIx-Class/trunk/Changes
   Catalyst-Authentication-Store-DBIx-Class/trunk/lib/Catalyst/Authentication/Store/DBIx/Class/User.pm
Log:
Merge branches/no-unneeded-fields into trunk



Property changes on: Catalyst-Authentication-Store-DBIx-Class/trunk
___________________________________________________________________
Added: svn:mergeinfo
   + /Catalyst-Authentication-Store-DBIx-Class/branches/no-unneeded-fields:14041-14042

Modified: Catalyst-Authentication-Store-DBIx-Class/trunk/Changes
===================================================================
--- Catalyst-Authentication-Store-DBIx-Class/trunk/Changes	2011-06-17 16:02:34 UTC (rev 14042)
+++ Catalyst-Authentication-Store-DBIx-Class/trunk/Changes	2011-06-17 16:03:55 UTC (rev 14043)
@@ -1,5 +1,9 @@
 Revision history for Catalyst-Plugin-Authentication-Store-DBIx-Class
 
+        * If use_userdata_from_session isn't set, then don't store more
+          fields than we need in the session -- only the fields we need to
+          load the object from the DB again.
+
 0.1500  2010-11-16
         * Allow specifying a fully loaded DBIC result in addition to resultsets
           of which only the first row is considered.

Modified: Catalyst-Authentication-Store-DBIx-Class/trunk/lib/Catalyst/Authentication/Store/DBIx/Class/User.pm
===================================================================
--- Catalyst-Authentication-Store-DBIx-Class/trunk/lib/Catalyst/Authentication/Store/DBIx/Class/User.pm	2011-06-17 16:02:34 UTC (rev 14042)
+++ Catalyst-Authentication-Store-DBIx-Class/trunk/lib/Catalyst/Authentication/Store/DBIx/Class/User.pm	2011-06-17 16:03:55 UTC (rev 14043)
@@ -165,7 +165,14 @@
     #return $frozenuser;
 
     my %userdata = $self->_user->get_columns();
-    return \%userdata;
+
+    # If use_userdata_from_session is set, then store all of the columns of the user obj in the session
+    if (exists($self->config->{'use_userdata_from_session'}) && $self->config->{'use_userdata_from_session'} != 0) {
+        return \%userdata;
+    } else { # Otherwise, we just need the PKs for load() to use.
+        my %pk_fields = map { ($_ => $userdata{$_}) } @{ $self->config->{id_field} };
+        return \%pk_fields;
+    }
 }
 
 sub from_session {




More information about the Catalyst-commits mailing list