[Jifty-commit] r5860 - in Jifty-DBI/trunk: lib/Jifty/DBI

Jifty commits jifty-commit at lists.jifty.org
Fri Sep 19 18:58:39 EDT 2008


Author: ruz
Date: Fri Sep 19 18:58:39 2008
New Revision: 5860

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

Log:
 r5879 at cubic-pc:  cubic | 2008-09-19 04:24:36 +0400
 * play with self/class only when passed argument is not a reference


Modified: Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm
==============================================================================
--- Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm	(original)
+++ Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm	Fri Sep 19 18:58:39 2008
@@ -1148,15 +1148,11 @@
 =cut
 
 sub load_from_hash {
-    my $class   = shift;
+    my $self    = shift;
     my $hashref = shift;
-    my ($self);
 
-    if ( ref($class) ) {
-        ( $self, $class ) = ( $class, undef );
-    } else {
-        $self = $class->new(
-            handle => ( delete $hashref->{'_handle'} || undef ) );
+    unless ( ref $self ) {
+        $self = $self->new( handle => delete $hashref->{'_handle'} );
     }
 
     $self->{values} = {};


More information about the Jifty-commit mailing list